Allow to interactively configure network for os download

This commit is contained in:
Juan Cruz Viotti 2015-03-09 19:42:43 -04:00
parent 1bb798a8b8
commit f0346b1fd0
3 changed files with 19 additions and 1 deletions

View File

@ -47,6 +47,17 @@
}; };
return async.waterfall([ return async.waterfall([
function(callback) { function(callback) {
if (osParams.network != null) {
return callback();
}
return visuals.patterns.selectNetworkParameters(function(error, parameters) {
if (error != null) {
return callback(error);
}
_.extend(osParams, parameters);
return callback();
});
}, function(callback) {
return mkdirp(path.dirname(options.output), _.unary(callback)); return mkdirp(path.dirname(options.output), _.unary(callback));
}, function(callback) { }, function(callback) {
var bar; var bar;

View File

@ -55,6 +55,13 @@ exports.download =
async.waterfall [ async.waterfall [
(callback) ->
return callback() if osParams.network?
visuals.patterns.selectNetworkParameters (error, parameters) ->
return callback(error) if error?
_.extend(osParams, parameters)
return callback()
(callback) -> (callback) ->
# We need to ensure this directory exists # We need to ensure this directory exists

View File

@ -61,7 +61,7 @@
"npm": "^2.6.1", "npm": "^2.6.1",
"open": "0.0.5", "open": "0.0.5",
"progress-stream": "^0.5.0", "progress-stream": "^0.5.0",
"resin-cli-visuals": "^0.0.7", "resin-cli-visuals": "^0.0.8",
"resin-sdk": "^0.0.2", "resin-sdk": "^0.0.2",
"underscore.string": "~2.4.0", "underscore.string": "~2.4.0",
"update-notifier": "^0.3.1" "update-notifier": "^0.3.1"