diff --git a/build/actions/app.js b/build/actions/app.js index 047dcd4c..73a52574 100644 --- a/build/actions/app.js +++ b/build/actions/app.js @@ -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 + ")"); diff --git a/lib/actions/app.coffee b/lib/actions/app.coffee index c3158006..e4033017 100644 --- a/lib/actions/app.coffee +++ b/lib/actions/app.coffee @@ -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})")