Sort the output of balena devices supported alphabetically by slug

Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
This commit is contained in:
Paulo Castro 2019-09-30 15:02:35 +01:00
parent 101a4bc209
commit d9b417e9e5

View File

@ -130,10 +130,8 @@ exports.supported =
visuals = require('resin-cli-visuals') visuals = require('resin-cli-visuals')
balena.models.config.getDeviceTypes().then (deviceTypes) -> balena.models.config.getDeviceTypes().then (deviceTypes) ->
console.log visuals.table.horizontal deviceTypes, [ fields = ['slug', 'name']
'slug' console.log visuals.table.horizontal(_.sortBy(deviceTypes, fields), fields)
'name'
]
.nodeify(done) .nodeify(done)
exports.register = exports.register =