首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复错误“不允许删除非目标项目路径["test-app/renderer/renderer.js%s"]。”在清理我的项目时?

如何修复错误“不允许删除非目标项目路径["test-app/renderer/renderer.js%s"]。”在清理我的项目时?
EN

Stack Overflow用户
提问于 2017-06-29 01:01:25
回答 1查看 210关注 0票数 3

当我运行lein clean时,我得到了这个错误:

代码语言:javascript
复制
Deleting non-target project paths ["test-app/renderer/renderer.js%s"] is not allowed.

是什么使路径成为目标项目路径?如何使路径成为目标项目路径?我的project.clj看起来像这样:

代码语言:javascript
复制
(defproject tech.projectx/clients "0.1.0-SNAPSHOT"
  :cljsbuild {:builds {:renderer      {:source-paths ["src/renderer" "src/common"]
                                       :compiler     {:output-to     "app/renderer/renderer.js"
                                                      :output-dir    "app/renderer"
                                                      :asset-path    "renderer"
                                                      :main          configurator.core
                                                      :language-in   :ecmascript5
                                                      :optimizations :none}}
                       :main          {:source-paths ["src/main" "src/common"]
                                       :compiler     {:output-to     "app/main/main.js"
                                                      :output-dir    "app/main"
                                                      :asset-path    "main"
                                                      :main          tech.projectx.main
                                                      :target        :nodejs
                                                      :externs       ["node_modules/closurecompiler-externs/path.js"
                                                                      "node_modules/closurecompiler-externs/process.js"]
                                                      :optimizations :simple}} ; without this, the packed application doesn't work.
                       :renderer-test {:source-paths ["src/renderer" "src/common" "test/renderer"]
                                       :compiler     {:output-to            "test-app/renderer/renderer.js"
                                                      :output-dir           "test-app/renderer"
                                                      :asset-path           "renderer"
                                                      :main                 clientcommon.test-runner
                                                      :language-in          :ecmascript5
                                                      :optimizations        :none
                                                      :source-map           true
                                                      :source-map-timestamp true
                                                      :pretty-print         true}
                                       :figwheel     {:websocket-host "localhost"
                                                      :on-jsload      "clientcommon.test-runner/run-all-tests"}}
                       :test-app-main {:source-paths ["test/main" "src/main" "src/common"]
                                       :compiler     {:output-to            "test-app/main/main.js"
                                                      :output-dir           "test-app/main"
                                                      :asset-path           "main"
                                                      :main                 tech.projectx.test-app-main
                                                      :target               :nodejs
                                                      :externs              ["node_modules/closurecompiler-externs/path.js"
                                                                             "node_modules/closurecompiler-externs/process.js"]
                                                      :optimizations        :none
                                                      :source-map           true
                                                      :source-map-timestamp true
                                                      :pretty-print         true}}}}

  :sass {:source-paths ["src/renderer/assets"]
         :target-path  "app/renderer/assets"
         :source-map   true}

  :figwheel {:server-logfile "log/figwheel-logfile.log"
             :css-dirs       ["app/renderer/assets"]}


  :clean-targets [[:cljsbuild :builds :renderer :compiler :output-to]
                  [:cljsbuild :builds :renderer :compiler :output-dir]
                  [:cljsbuild :builds :main :compiler :output-to]
                  [:cljsbuild :builds :main :compiler :output-dir]
                  [:cljsbuild :builds :renderer-test :compiler :output-to]
                  [:cljsbuild :builds :renderer-test :compiler :output-dir]
                  [:cljsbuild :builds :test-app-main :compiler :output-to]
                  [:cljsbuild :builds :test-app-main :compiler :output-dir]
                  "dist"]

  :profiles {:dev  {:cljsbuild {:builds {:renderer {:compiler {:source-map           true
                                                               :source-map-timestamp true
                                                               :pretty-print         true}
                                                    :figwheel {:websocket-host "localhost"
                                                               :on-jsload      "configurator.core/mount-root"}}
                                         :main     {:compiler {:source-map           "app/main/main.js.map"
                                                               :source-map-timestamp true
                                                               :pretty-print         true}}}}}
             :prod {:cljsbuild {:builds {:renderer {:compiler {:optimizations   :simple
                                                               :closure-defines {goog.DEBUG false}}}
                                         :main     {:compiler {:optimizations   :simple
                                                               :closure-defines {goog.DEBUG false}}}}}}})
EN

回答 1

Stack Overflow用户

发布于 2017-06-29 01:59:17

这是一个内置的安全机制,可以防止你意外删除不需要的东西(例如项目目录之外的内容)。如果您仍要继续进行清理,请像这样修改您的project.clj:

代码语言:javascript
复制
:clean-targets ^{:protect false} [....]

有关更多详细信息,请查看以下源代码中的健全性检查和受保护路径函数:https://github.com/technomancy/leiningen/blob/master/src/leiningen/clean.clj

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44808615

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档