Improve the supported device types listing

This commit is contained in:
Eugene Mirotin 2017-06-12 13:27:15 +03:00
parent 4ac8cb1003
commit 97480d3aa4
3 changed files with 12 additions and 5 deletions

View File

@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add the `resin os build-config` method to pass the interactive config step once - Add the `resin os build-config` method to pass the interactive config step once
and reuse the built file for consequent `resin os configure` calls (added the new `--config` param to it), and reuse the built file for consequent `resin os configure` calls (added the new `--config` param to it),
and for `resin device init` (same `--config` param) and for `resin device init` (same `--config` param)
- Improve the supported device types listing
### Fixed ### Fixed

View File

@ -72,10 +72,11 @@ exports.supported = {
description: 'list all supported devices', description: 'list all supported devices',
help: 'Use this command to get the list of all supported devices\n\nExamples:\n\n $ resin devices supported', help: 'Use this command to get the list of all supported devices\n\nExamples:\n\n $ resin devices supported',
action: function(params, options, done) { action: function(params, options, done) {
var resin; var resin, visuals;
resin = require('resin-sdk-preconfigured'); resin = require('resin-sdk-preconfigured');
return resin.models.config.getDeviceTypes().each(function(deviceType) { visuals = require('resin-cli-visuals');
return console.log(deviceType.slug); return resin.models.config.getDeviceTypes().then(function(deviceTypes) {
return console.log(visuals.table.horizontal(deviceTypes, ['slug', 'name']));
}).nodeify(done); }).nodeify(done);
} }
}; };

View File

@ -116,8 +116,13 @@ exports.supported =
''' '''
action: (params, options, done) -> action: (params, options, done) ->
resin = require('resin-sdk-preconfigured') resin = require('resin-sdk-preconfigured')
resin.models.config.getDeviceTypes().each (deviceType) -> visuals = require('resin-cli-visuals')
console.log(deviceType.slug)
resin.models.config.getDeviceTypes().then (deviceTypes) ->
console.log visuals.table.horizontal deviceTypes, [
'slug'
'name'
]
.nodeify(done) .nodeify(done)
exports.register = exports.register =