Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Fix incorrect format of file permission #504

Merged
merged 2 commits into from
Feb 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tasks/build/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var

function build(src, config) {
return gulp.src(src, {base: config.paths.source.themes})
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulp.dest(config.paths.output.themes))
.pipe(print(log.created))
;
Expand Down
4 changes: 2 additions & 2 deletions tasks/build/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function build(src, type, compress, config, opts) {
compress ? config.paths.assets.compressed : config.paths.assets.uncompressed))
.pipe(gulpif(compress, minifyCSS(settings.minify)))
.pipe(gulpif(fileExtension, rename(fileExtension)))
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulp.dest(compress ? config.paths.output.compressed : config.paths.output.uncompressed))
.pipe(print(log.created))
;
Expand All @@ -104,7 +104,7 @@ function pack(type, compress) {
.pipe(dedupe())
.pipe(replace(assets.uncompressed, assets.packaged))
.pipe(concatCSS(concatenatedCSS, settings.concatCSS))
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulpif(compress, minifyCSS(settings.concatMinify)))
.pipe(header(banner, settings.header))
.pipe(gulp.dest(output.packaged))
Expand Down
6 changes: 3 additions & 3 deletions tasks/build/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ function build(src, type, config) {
.pipe(plumber())
.pipe(flatten())
.pipe(replace(comments.license.in, comments.license.out))
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulp.dest(config.paths.output.uncompressed))
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
.pipe(print(log.created))
.pipe(uglify(settings.uglify))
.pipe(rename(settings.rename.minJS))
.pipe(header(banner, settings.header))
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulp.dest(config.paths.output.compressed))
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
.pipe(print(log.created))
;
}
Expand All @@ -79,7 +79,7 @@ function pack(type, compress) {
.pipe(concat(concatenatedJS))
.pipe(gulpif(compress, uglify(settings.concatUglify)))
.pipe(header(banner, settings.header))
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulp.dest(output.packaged))
.pipe(print(log.created))
;
Expand Down
2 changes: 2 additions & 0 deletions tasks/config/project/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ module.exports = {

if(config.permission) {
config.hasPermissions = true;
config.parsedPermissions = typeof config.permission === 'string' ? parseInt(config.permission, 8) : config.permission;
}
else {
// pass blank object to avoid causing errors
config.permission = {};
config.hasPermissions = false;
config.parsedPermissions = {};
}

/*--------------
Expand Down