Print ssh key separately from the information table

Since the public key string is long, it might wrap to lines below,
causing the table layout to break.

A quick solutio is to print the ssh key after the table.

Fixes:

- https://github.com/resin-io/resin-cli/issues/151
This commit is contained in:
Juan Cruz Viotti 2015-08-14 12:25:55 -04:00
parent 83382cc8f7
commit e712e2f266
2 changed files with 11 additions and 2 deletions

View File

@ -38,7 +38,8 @@
permission: 'user',
action: function(params, options, done) {
return resin.models.key.get(params.id).then(function(key) {
return console.log(visuals.table.vertical(key, ['id', 'title', 'public_key']));
console.log(visuals.table.vertical(key, ['id', 'title']));
return console.log('\n' + key.public_key);
}).nodeify(done);
}
};

View File

@ -37,7 +37,15 @@ exports.info =
permission: 'user'
action: (params, options, done) ->
resin.models.key.get(params.id).then (key) ->
console.log visuals.table.vertical key, [ 'id', 'title', 'public_key' ]
console.log visuals.table.vertical key, [
'id'
'title'
]
# Since the public key string is long, it might
# wrap to lines below, causing the table layout to break.
# See https://github.com/resin-io/resin-cli/issues/151
console.log('\n' + key.public_key)
.nodeify(done)
exports.remove =