mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 22:23:07 +00:00
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:
commit
485818f3b5
@ -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 + ")");
|
||||
|
@ -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})")
|
||||
|
Loading…
Reference in New Issue
Block a user