Remove readonly attribute of windows file in gulp file

How to remove readonly attribute from all files in a folder in Windows?

UPDATE : The question is how to remove the readonly attribute using gulpfile

+3
source share
2 answers

I understood the answer:

To remove the readonly attribute of all files in a directory recursively, we run the following command in Windows Command Prompt

attrib -r <dir-name>\*.* /s

The next gulp task removes the readonly attribute of all files in

gulp.task('remove-readonly-attributes', function() {
    require("child_process").exec("attrib -r <dir-name>\*.* /s");
});
+5
source

I decided to solve this problem with gulp -chmod.

https://www.npmjs.com/package/gulp-chmod

+2
source

Source: https://habr.com/ru/post/1650119/


All Articles