mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 17:33:18 +00:00
Merge pull request #2 from resin-io/feature/whoami
Reimplement whoami command
This commit is contained in:
commit
fa5a7abbbf
@ -11,6 +11,22 @@
|
||||
|
||||
visuals = require('resin-cli-visuals');
|
||||
|
||||
exports.whoami = {
|
||||
signature: 'whoami',
|
||||
description: 'whoami',
|
||||
help: 'Use this command to get the logged in user name.\n\nExamples:\n\n $ resin whoami',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.auth.whoami(function(error, username) {
|
||||
if (error != null) {
|
||||
return done(error);
|
||||
}
|
||||
console.log(username);
|
||||
return done();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.login = {
|
||||
signature: 'login',
|
||||
description: 'login to resin.io',
|
||||
|
@ -4,6 +4,23 @@ async = require('async')
|
||||
resin = require('resin-sdk')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
exports.whoami =
|
||||
signature: 'whoami'
|
||||
description: 'whoami'
|
||||
help: '''
|
||||
Use this command to get the logged in user name.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin whoami
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin.auth.whoami (error, username) ->
|
||||
return done(error) if error?
|
||||
console.log(username)
|
||||
return done()
|
||||
|
||||
exports.login =
|
||||
signature: 'login'
|
||||
description: 'login to resin.io'
|
||||
|
@ -62,7 +62,7 @@
|
||||
"open": "0.0.5",
|
||||
"progress-stream": "^0.5.0",
|
||||
"resin-cli-visuals": "^0.1.0",
|
||||
"resin-sdk": "^1.0.0",
|
||||
"resin-sdk": "^1.1.0",
|
||||
"resin-settings-client": "^1.0.0",
|
||||
"resin-vcs": "^1.0.0",
|
||||
"underscore.string": "~2.4.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user