- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建一个 Grunt 任务来清理目录中的所有文件、子目录及其文件等。
我可以删除所有文件,但文件夹始终保留。
clean: {
preview: ["live_preview>/**/*"],
dist: ["dist/**/*"]
},
cleanempty: {
options: {
folders: true
},
src: ['live_preview/**', 'tmp/**']
},
我正在尝试清空 live_preview
文件夹。我尝试了几种通配符的组合。更令人费解的是,-v
的终端输出使它看起来好像有效,但空文件夹仍然存在。
Verifying property cleanempty.src exists in config...OK
Files: live_preview, live_preview/fonts, live_preview/images, live_preview/partials, live_preview/partials/elements, live_preview/scripts, live_preview/scripts/data, live_preview/styles, live_preview/views, tmp, tmp/styles, tmp/styles/live_preview.css, tmp/styles/live_preview.css.map, tmp/styles/theme.css, tmp/styles/theme.css.map -> src
Options: folders
Options: files, folders, force=false, no-write=false
Options: files, folders, force=false, no-write=false
Cleaning live_preview/views...Deleting live_preview/views...OK
OK
Cleaning live_preview/styles...Deleting live_preview/styles...OK
OK
Cleaning live_preview/scripts/data...Deleting live_preview/scripts/data...OK
OK
Cleaning live_preview/partials/elements...Deleting live_preview/partials/elements...OK
OK
Cleaning live_preview/images...Deleting live_preview/images...OK
OK
Cleaning live_preview/fonts...Deleting live_preview/fonts...OK
OK
Done, without errors.
最佳答案
我正在使用 Grunt 任务来清理临时目录,当我运行该任务时,整个文件夹将被删除。我假设您使用的是相同的插件,但只是为了确定:https://github.com/gruntjs/grunt-contrib-clean
这是我的设置的简化版本:
clean: {
tests: ['testXmls'] // testXmls is a directory in the top level of my app
}
grunt.registerTask('clean-tests', ['clean:tests']);
当我运行 grunt clean-tests 时,testXmls 目录及其所有内容都会被删除。
我认为你的问题是你在目录路径中使用通配符来告诉 grunt 删除 live_preview 的所有子目录。如果您想删除顶级目录,则只需使用它即可。其中包含的所有文件和目录都将被递归删除。认为 rm -rf
尝试:
clean: {
preview: ["live_preview"],
dist: ["dist"]
}
此外,在您的终端中,当您看到:
Deleting live_preview/styles
这只是意味着它正在删除 styles 目录 - 它为您提供了/styles 的完整路径,而 live_preview 是该路径的一部分,这就是您看到它的原因 - 没有任何迹象表明 live_preview 本身已被删除。所以输出实际上是正确的。
关于javascript - 在 Grunt.js 中使用 clean 或 clean-empty 任务删除空文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23661807/
假设我想在编译项目之前将项目本地依赖项(jar 文件)安装到本地 Maven 存储库 (~/.m2),这样我就可以在 POM 中引用它们,就像引用 Maven 中的任何依赖项一样中央。目前,我正在使用
我需要使用 Clean 编程语言列出目录中的所有文件,但我不知道这样做的任何函数。有人可以帮助我吗? 最佳答案 您可以使用 Directory module 中的函数 getDirectoryCont
我的应用程序工作正常,我能够使用 jar 执行 mvn clean install并能够执行 jar 文件,但我将其更改为 war 文件,但我无法执行 mvn clean install . 这些之间
我是 Maven 的初学者。当我点击 clean & Build 在 netbeans 中重建我的项目时,它抛出一个错误 Failed to execute goal org.apache.maven
我已经为我的一些模型覆盖了 clean() 方法来构造约束以满足我的数据库架构要求(因为它需要运行时信息来进行这些验证)。 从现在开始,我已经完成了大部分后端组件(模型、信号、..),现在我正在尝试编
从 Android Studio 项目的终端发出以下语句有什么区别: Android_Studio_Project_Path: ./gradlew clean Android_Studio_Proje
我曾在不同的团队工作过,在一个团队中,人们倾向于在合并旧分支后立即清理它们。在其他团队分支永远停留。删除/保留旧分支有什么好处?这是否取决于我们使用的源代码控制系统? (在我的情况下 - SVN)。
我有一个相当复杂的(iPhone SDK)Xcode 项目,有很多目标——4 个静态库、单元测试、多个示例应用程序、一个运行 shell 脚本的 BuildAll 以及一个运行另一个 shell 脚本
我有一个 cucumber 项目,当您单独运行 cucumberrunner 文件时,该项目运行良好 [运行方式 -->Junit 测试]。 当我尝试使用 maven 命令运行相同的文件时,它失败了:
我在 cruiseControl 中有一个 msbuild 任务,它首先清除然后重建。如果我将其更改为“清理并构建”(而不是重建),会有什么不同吗? Rebuild 为每个项目执行“清理 + 构建”。
我对 Clean Architecture 中的 Gateway to Entity 依赖有疑问。我认为以下同心圆图形经常被介绍为整洁的架构。 在上图中,Gateway并没有直视Entity。但是,还
我使用M2e + Eclipse + Maven,我想知道两者之间的区别: 在终端和中运行“mvn clean” 从Eclipse 运行“干净的项目”吗? 有人可以请教吗? 最佳答案 通过一些快速测试
我试图弄清楚 package.json 脚本部分中“clean:dist”或“clean:js”与“clean”的作用?我在网上搜索并查看了NPM documentation但找不到任何线索。那么有人
我在 Linux 上的构建过程有一个小问题。 无论出于何种原因,在我的代码中,如果我发出“make clean”命令,Linux 会生成一个名为“clean”的文件。问题是我的项目的 makefile
mvn clean package和mvn clean install到底有什么区别?当我运行这两个命令时,它们似乎都在做同样的事情。 最佳答案 好吧,两者都会清理。这意味着他们将删除目标文件夹。真正
您在每个应用程序的开发过程中都遇到了某个时刻,您在模拟器中看到的内容与您认为应该发生的情况不符。这些大多是人为错误——或者至少在大多数我的案例中是这样的;-)——但有时 Xcode 只是“迷失了方向”
我使用这两个命令来解决我项目中的依赖问题。 mvn -U clean compile解决的问题。但我不知道它们之间的区别。请解释这些命令之间的区别以及我何时使用 mvn clean compile和
我正在为我的项目使用 Maven。如果我的项目不使用某些本地资源,这不是问题。 以便我遵循本指南 https://stackoverflow.com/a/61576687/6720896 将我的本地
我正在尝试创建一个 Grunt 任务来清理目录中的所有文件、子目录及其文件等。 我可以删除所有文件,但文件夹始终保留。 clean: { preview: ["live_previe
我有以下情况: 我有一个包含几个子项目的项目。今天我尝试通过命令行使用 gradle 构建项目。 执行 ./gradlew clean :build 时构建成功, 但不是 ./gradlew clea
我是一名优秀的程序员,十分优秀!