grunt.file write/copy with permissions

1k views Asked by At

Is there a way to specify the permissions of a file during a grunt.file.copy(...), except using the 'fs.chmod' after copy has finished?

I will have to require the whole 'fs' module otherwise, just for changing the permissions. Will it be a lot of overhead?

1

There are 1 answers

2
Xavier Priour On BEST ANSWER

grunt.file.copy does not provide any option for that, unfortunately.

But the grunt copy task (from grunt-contrib-copy) has an option for that (options.mode, see https://github.com/gruntjs/grunt-contrib-copy#mode).