Skip to content

Commit e03b496

Browse files
committed
move the func to utils
1 parent 72e9efd commit e03b496

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

bin/commands/runs.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ module.exports = function run(args) {
2020
// setting setDefaultAuthHash to {} if not present and set via env variables or via args.
2121
utils.setDefaultAuthHash(bsConfig,args);
2222

23+
// setting npm_dependencies to {} if not present
24+
utils.setDefaultNpmHash(bsConfig);
25+
2326
// accept the username from command line or env variable if provided
2427
utils.setUsername(bsConfig, args);
2528

bin/helpers/archiver.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ const archiveSpecs = (runSettings, filePath, excludeFiles) => {
5151
Object.assign(packageJSON, runSettings.package_config_options);
5252
}
5353

54-
if (!runSettings.npm_dependencies) runSettings.npm_dependencies = {}
55-
5654
if (typeof runSettings.npm_dependencies === 'object') {
5755
Object.assign(packageJSON, {devDependencies: runSettings.npm_dependencies});
5856
}

bin/helpers/utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ exports.setDefaultAuthHash = (bsConfig, args) => {
125125
}
126126
}
127127

128+
exports.setDefaultNpmHash = (bsConfig) => {
129+
if (bsConfig.run_settings && !bsConfig.run_settings.npm_dependencies) {
130+
bsConfig.run_settings.npm_dependencies = {}
131+
}
132+
}
133+
128134
exports.setUsername = (bsConfig, args) => {
129135
if (!this.isUndefined(args.username)) {
130136
bsConfig["auth"]["username"] = args.username;

0 commit comments

Comments
 (0)