在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):sindresorhus/gulp-chmod开源软件地址(OpenSource Url):https://github.com/sindresorhus/gulp-chmod开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-chmod
Install
Usageconst gulp = require('gulp');
const chmod = require('gulp-chmod');
exports.default = () => (
gulp.src('src/app.js')
.pipe(chmod(0o755))
.pipe(gulp.dest('dist'))
); or const gulp = require('gulp');
const chmod = require('gulp-chmod');
exports.default = () => (
gulp.src('src/app.js')
.pipe(chmod({
owner: {
read: true,
write: true,
execute: true
},
group: {
execute: true
},
others: {
execute: true
}
}))
.pipe(gulp.dest('dist'))
); APIchmod(fileMode, directoryMode?)fileModeType: Can either be a chmod 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
}
} When {
read: true
} Pass directoryModeType: Same as Specify TipCombine it with gulp-filter to only change permissions on a subset of the files. const gulp = require('gulp');
const gFilter = require('gulp-filter');
const chmod = require('gulp-chmod');
const filter = gFilter('src/cli.js', {restore: true});
exports.default = () => (
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'))
); Related
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论