- Notifications
You must be signed in to change notification settings - Fork9
Change permissions of Vinyl files
License
NotificationsYou must be signed in to change notification settings
sindresorhus/gulp-chmod
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Change permissions ofVinyl files
npm install --save-dev gulp-chmod
importgulpfrom'gulp';importchmodfrom'gulp-chmod';exportdefault()=>(gulp.src('src/app.js').pipe(chmod(0o755)).pipe(gulp.dest('dist')));
or
importgulpfrom'gulp';importchmodfrom'gulp-chmod';exportdefault()=>(gulp.src('src/app.js').pipe(chmod({owner:{read:true,write:true,execute:true},group:{execute:true},others:{execute:true}})).pipe(gulp.dest('dist')));
Type:number | object
Can either be achmod octal number or an object with the individual permissions specified.
Values depends on the current file, but these are the possible keys:
{owner:{read:true,write:true,execute:true},group:{read:true,write:true,execute:true},others:{read:true,write:true,execute:true}}
Whenread
,write
, andexecute
are the same, you can simplify the object:
{read:true}
Passundefined
to not set permissions on files. Useful if you only want to set permissions on directories.
Type:true | number | object
Same asfileMode
, but applies to directories.
Specifytrue
to use the same value asfileMode
.
Combine it withgulp-filter to only change permissions on a subset of the files.
importgulpfrom'gulp';importchmodfrom'gulp-chmod';importgulpFilterfrom'gulp-filter';constfilter=gulpFilter('src/cli.js',{restore:true});exportdefault=()=>(gulp.src('src/*.js')// Filter a subset of the files.pipe(filter)// Make them executable.pipe(chmod(0o755))// Bring back the previously filtered out files.pipe(filter.restore).pipe(gulp.dest('dist')));
- gulp-chown - Change owner of Vinyl files
About
Change permissions of Vinyl files
Topics
Resources
License
Code of conduct
Security policy
Stars
Watchers
Forks
Packages0
No packages published