问题
How can we remove readonly attribute from all files under a folder in Windows?
UPDATE: The question is more about how to remove readonly attribute using gulpfile
回答1:
I figured out the answer:
To remove readonly attribute of all files under a directory recursively, we run the following command in windows Command line
attrib -r <dir-name>\*.* /s
Following gulp task removes readonly attribute of all files under
gulp.task('remove-readonly-attributes', function() {
require("child_process").exec("attrib -r <dir-name>\*.* /s");
});
回答2:
I ended up solving this problem with gulp-chmod.
https://www.npmjs.com/package/gulp-chmod
来源:https://stackoverflow.com/questions/29483772/remove-windows-file-readonly-attribute-in-gulp-file