我正在尝试编写一个删除目录及其内容的任务。
这是配置文件
{
"name": "lorem",
"homepage": "ipsum",
"version": "0.9.5",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-shell": "~0.5.0",
}
}和grunt.js文件
// Whole Gruntfile.js so far
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
clean: {
command: 'rm dist -r',
options: { stdout: true, failOnError: true }
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['shell:clean']);
};这可能适用于linux,但是如果机器是windows或osx呢?有什么跨平台的解决方案吗?
https://stackoverflow.com/questions/24161185
复制相似问题