我想創建一個咕嚕任務清理掉所有的文件,子目錄的目錄及其文件等等刪除空文件夾,在Grunt.js
我可以刪除所有的文件,但文件夾始終保持。
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.