Merge pull request #233 from resin-io/jviotti/fix/app-create-type

Fix --type option taking no effect in app create
This commit is contained in:
Juan Cruz Viotti 2015-10-19 14:03:59 -04:00
commit 485818f3b5
2 changed files with 6 additions and 2 deletions

View File

@ -36,7 +36,9 @@
if (hasApplication) {
throw new Error('You already have an application with that name!');
}
}).then(patterns.selectDeviceType).then(function(deviceType) {
}).then(function() {
return options.type || patterns.selectDeviceType();
}).then(function(deviceType) {
return resin.models.application.create(params.name, deviceType);
}).then(function(application) {
console.info("Application created: " + application.app_name + " (" + application.device_type + ", id " + application.id + ")");

View File

@ -44,7 +44,9 @@ exports.create =
if hasApplication
throw new Error('You already have an application with that name!')
.then(patterns.selectDeviceType).then (deviceType) ->
.then ->
return options.type or patterns.selectDeviceType()
.then (deviceType) ->
return resin.models.application.create(params.name, deviceType)
.then (application) ->
console.info("Application created: #{application.app_name} (#{application.device_type}, id #{application.id})")