diff --git a/build/actions/device.js b/build/actions/device.js index 2a88e4b2..77479f6a 100644 --- a/build/actions/device.js +++ b/build/actions/device.js @@ -120,17 +120,7 @@ if (options.application != null) { return callback(null, options.application); } - return vcs.getApplicationId(process.cwd(), function(error, applicationId) { - 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); - }); - }); + return vcs.getApplicationName(process.cwd(), callback); }, function(applicationName, callback) { params.name = applicationName; if (params.device != null) { diff --git a/lib/actions/device.coffee b/lib/actions/device.coffee index 14fa9c41..fe34f6f6 100644 --- a/lib/actions/device.coffee +++ b/lib/actions/device.coffee @@ -195,13 +195,7 @@ exports.init = (callback) -> return callback(null, options.application) if options.application? - - # 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) + vcs.getApplicationName(process.cwd(), callback) (applicationName, callback) -> params.name = applicationName diff --git a/package.json b/package.json index 718ad506..72f805e5 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "resin-cli-visuals": "^0.1.0", "resin-sdk": "^1.2.0", "resin-settings-client": "^1.0.0", - "resin-vcs": "^1.1.0", + "resin-vcs": "^1.2.0", "underscore.string": "~2.4.0", "update-notifier": "^0.3.1" }