mirror of
https://github.com/bpatrik/pigallery2.git
synced 2026-06-20 00:15:49 +02:00
adding switch to force optDeps for docker
This commit is contained in:
+13
-3
@@ -12,14 +12,17 @@ const translationFolder = 'translate';
|
||||
const tsBackendProject = ts.createProject('tsconfig.json');
|
||||
declare var process: NodeJS.Process;
|
||||
|
||||
const getSwitch = (name: string, def: string = null) => {
|
||||
const getSwitch = (name: string, def: string = null): string => {
|
||||
name = '--' + name;
|
||||
for (let i = 0; i < process.argv.length; i++) {
|
||||
if (process.argv[i].startsWith(name + '=')) {
|
||||
return process.argv[i].replace(name + '=', '').trim();
|
||||
}
|
||||
if (process.argv[i].startsWith(name) && i + 1 < process.argv.length) {
|
||||
return process.argv[i + 1].trim();
|
||||
if (process.argv[i].startsWith(name)) {
|
||||
if (i + 1 < process.argv.length) {
|
||||
return process.argv[i + 1].trim();
|
||||
}
|
||||
return 'true';
|
||||
}
|
||||
}
|
||||
return def;
|
||||
@@ -129,6 +132,13 @@ gulp.task('copy-package', function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!!getSwitch('force-opt-packages')) {
|
||||
for (const key of Object.keys(json.optionalDependencies)) {
|
||||
json.dependencies[key] = json.optionalDependencies[key];
|
||||
}
|
||||
delete json.optionalDependencies;
|
||||
}
|
||||
return json;
|
||||
}))
|
||||
.pipe(gulp.dest('./release'));
|
||||
|
||||
Reference in New Issue
Block a user