我正在尝试创建一个 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.