grunt-contrib-copy icon indicating copy to clipboard operation
grunt-contrib-copy copied to clipboard

mode:true has no effect

Open s-a opened this issue 8 years ago • 12 comments

Copy file permission execute does not work. Testet on ubuntu with v0.8.0. Maybe other operating systems affected?

s-a avatar Jul 07 '15 04:07 s-a

+1 me too. really need this to work. using grunt-chmod for now, which is a shame..

+1

mpint avatar Aug 10 '15 17:08 mpint

I serious suggest cp -rp :+1:

s-a avatar Aug 10 '15 17:08 s-a

+1

not working on OSX either

johnpapa avatar Aug 17 '15 22:08 johnpapa

+1

chintan-patel avatar Aug 17 '15 23:08 chintan-patel

I made a PR to fix this here https://github.com/gruntjs/grunt-contrib-copy/pull/249

johnpapa avatar Aug 17 '15 23:08 johnpapa

FYI - this is the commit where it happened https://github.com/gruntjs/grunt-contrib-copy/commit/7f6f25822b1c6797318062115b8a62b4e41272f6

johnpapa avatar Aug 17 '15 23:08 johnpapa

PR not needed if we set options.mode = '755'. I've got what I need now.

johnpapa avatar Aug 18 '15 12:08 johnpapa

grunt.file.copy(from, to, {mode: '0755'})

by the way, does not work as well

monolithed avatar Aug 26 '15 22:08 monolithed

IMHO all options that Unix cp has should be available for the standard Grunt task.

masi avatar Dec 04 '15 14:12 masi

It doesn't look like the PR was ever merged. At the very least, documentation should be updated to indicate that the property only accepts octal permissions.

raijinsetsu avatar May 23 '16 16:05 raijinsetsu

This config seems to preserve the file perms on MacOS:

copy: {
  example: {
    options: {
        mode: true,
    },
    files: [
        {
            src: ['file1', 'file2'],
        },
    ]
  },
}

watsoncj avatar Jun 27 '18 00:06 watsoncj