Gautam
Gautam

Reputation: 108

grunt.file write/copy with permissions

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?

Upvotes: 0

Views: 1009

Answers (1)

Xavier Priour
Xavier Priour

Reputation: 2121

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).

Upvotes: 2

Related Questions