Skip to content

Commit

Permalink
Fixes silent install default values. See #146
Browse files Browse the repository at this point in the history
  • Loading branch information
cvasseng committed Jul 27, 2018
1 parent 8932186 commit b7d1ea6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Added `;` between included scripts. Fixes map collections (#128)
* Added `--skipKey` and `--skipToken` CLI options to configure the rate limiter
* Added `--queueSize` switch to the CLI options to set the overflow queue size
* Fixed issue with silent installs and default values

# 2.0.14

Expand Down
13 changes: 9 additions & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,16 @@ function startPrompt() {
});
}

function useIfDefined(what, def) {
return (typeof what === 'undefined' ? def : what);
}

if (process.env.ACCEPT_HIGHCHARTS_LICENSE) {
embedAll(process.env.HIGHCHARTS_VERSION || 'latest',
process.env.HIGHCHARTS_USE_STYLED || true,
process.env.HIGHCHARTS_USE_MAPS || true,
process.env.HIGHCHARTS_MOMENT || false
embedAll(
useIfDefined(process.env.HIGHCHARTS_VERSION, 'latest'),
useIfDefined(process.env.HIGHCHARTS_USE_STYLED, true),
useIfDefined(process.env.HIGHCHARTS_USE_MAPS, true),
useIfDefined(process.env.HIGHCHARTS_MOMENT, false)
);
} else {
console.log(fs.readFileSync(__dirname + '/msg/licenseagree.msg').toString().bold);
Expand Down

0 comments on commit b7d1ea6

Please sign in to comment.