Upgrade Resin VCS to v1.2.0 and make use of vcs.getApplicationName()

This commit is contained in:
Juan Cruz Viotti 2015-04-20 11:41:26 -04:00
parent 42b2e2fcf0
commit 7bd8922a4e
3 changed files with 3 additions and 19 deletions

View File

@ -120,17 +120,7 @@
if (options.application != null) { if (options.application != null) {
return callback(null, options.application); return callback(null, options.application);
} }
return vcs.getApplicationId(process.cwd(), function(error, applicationId) { return vcs.getApplicationName(process.cwd(), callback);
if (error != null) {
return callback(error);
}
return resin.models.application.getById(applicationId, function(error, application) {
if (error != null) {
return callback(error);
}
return callback(null, application.app_name);
});
});
}, function(applicationName, callback) { }, function(applicationName, callback) {
params.name = applicationName; params.name = applicationName;
if (params.device != null) { if (params.device != null) {

View File

@ -195,13 +195,7 @@ exports.init =
(callback) -> (callback) ->
return callback(null, options.application) if options.application? return callback(null, options.application) if options.application?
vcs.getApplicationName(process.cwd(), callback)
# TODO: Extract this to vcs.getApplicationName()
vcs.getApplicationId process.cwd(), (error, applicationId) ->
return callback(error) if error?
resin.models.application.getById applicationId, (error, application) ->
return callback(error) if error?
return callback(null, application.app_name)
(applicationName, callback) -> (applicationName, callback) ->
params.name = applicationName params.name = applicationName

View File

@ -65,7 +65,7 @@
"resin-cli-visuals": "^0.1.0", "resin-cli-visuals": "^0.1.0",
"resin-sdk": "^1.2.0", "resin-sdk": "^1.2.0",
"resin-settings-client": "^1.0.0", "resin-settings-client": "^1.0.0",
"resin-vcs": "^1.1.0", "resin-vcs": "^1.2.0",
"underscore.string": "~2.4.0", "underscore.string": "~2.4.0",
"update-notifier": "^0.3.1" "update-notifier": "^0.3.1"
} }