Skip to content

Commit b7d1ea6

Browse files
committed
Fixes silent install default values. See #146
1 parent 8932186 commit b7d1ea6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Added `;` between included scripts. Fixes map collections (#128)
55
* Added `--skipKey` and `--skipToken` CLI options to configure the rate limiter
66
* Added `--queueSize` switch to the CLI options to set the overflow queue size
7+
* Fixed issue with silent installs and default values
78

89
# 2.0.14
910

build.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,16 @@ function startPrompt() {
362362
});
363363
}
364364

365+
function useIfDefined(what, def) {
366+
return (typeof what === 'undefined' ? def : what);
367+
}
368+
365369
if (process.env.ACCEPT_HIGHCHARTS_LICENSE) {
366-
embedAll(process.env.HIGHCHARTS_VERSION || 'latest',
367-
process.env.HIGHCHARTS_USE_STYLED || true,
368-
process.env.HIGHCHARTS_USE_MAPS || true,
369-
process.env.HIGHCHARTS_MOMENT || false
370+
embedAll(
371+
useIfDefined(process.env.HIGHCHARTS_VERSION, 'latest'),
372+
useIfDefined(process.env.HIGHCHARTS_USE_STYLED, true),
373+
useIfDefined(process.env.HIGHCHARTS_USE_MAPS, true),
374+
useIfDefined(process.env.HIGHCHARTS_MOMENT, false)
370375
);
371376
} else {
372377
console.log(fs.readFileSync(__dirname + '/msg/licenseagree.msg').toString().bold);

0 commit comments

Comments
 (0)