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
CHANGELOG.md
build/actions
lib/actions

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
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)
- Improve the supported device types listing
### Fixed

View File

@ -72,10 +72,11 @@ exports.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',
action: function(params, options, done) {
var resin;
var resin, visuals;
resin = require('resin-sdk-preconfigured');
return resin.models.config.getDeviceTypes().each(function(deviceType) {
return console.log(deviceType.slug);
visuals = require('resin-cli-visuals');
return resin.models.config.getDeviceTypes().then(function(deviceTypes) {
return console.log(visuals.table.horizontal(deviceTypes, ['slug', 'name']));
}).nodeify(done);
}
};

View File

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