Merge pull request #396 from resin-io/devices-supported

Bring back `devices supported` command
This commit is contained in:
Juan Cruz Viotti 2016-09-25 19:51:02 -04:00 committed by GitHub
commit e2cb79edb1
4 changed files with 34 additions and 0 deletions

View File

@ -67,6 +67,20 @@ limitations under the License.
}
};
exports.supported = {
signature: 'devices supported',
description: 'list all supported devices',
help: 'Use this command to get the list of all supported devices\n\nExamples:\n\n $ resin devices supported',
permission: 'user',
action: function(params, options, done) {
var resin;
resin = require('resin-sdk');
return resin.models.config.getDeviceTypes().each(function(deviceType) {
return console.log(deviceType.slug);
}).nodeify(done);
}
};
exports.register = {
signature: 'device register <application>',
description: 'register a device',

View File

@ -85,6 +85,8 @@ limitations under the License.
capitano.command(actions.device.list);
capitano.command(actions.device.supported);
capitano.command(actions.device.rename);
capitano.command(actions.device.init);

View File

@ -102,6 +102,23 @@ exports.info =
]
.nodeify(done)
exports.supported =
signature: 'devices supported'
description: 'list all supported devices'
help: '''
Use this command to get the list of all supported devices
Examples:
$ resin devices supported
'''
permission: 'user'
action: (params, options, done) ->
resin = require('resin-sdk')
resin.models.config.getDeviceTypes().each (deviceType) ->
console.log(deviceType.slug)
.nodeify(done)
exports.register =
signature: 'device register <application>'
description: 'register a device'

View File

@ -70,6 +70,7 @@ capitano.command(actions.app.info)
# ---------- Device Module ----------
capitano.command(actions.device.list)
capitano.command(actions.device.supported)
capitano.command(actions.device.rename)
capitano.command(actions.device.init)
capitano.command(actions.device.remove)