mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 10:46:34 +00:00
Merge pull request #68 from resin-io/feature/config
Implement config command
This commit is contained in:
commit
73736abdea
@ -1,5 +1,7 @@
|
||||
(function() {
|
||||
var packageJSON;
|
||||
var packageJSON, settings;
|
||||
|
||||
settings = require('resin-settings-client');
|
||||
|
||||
packageJSON = require('../../package.json');
|
||||
|
||||
@ -13,4 +15,19 @@
|
||||
}
|
||||
};
|
||||
|
||||
exports.config = {
|
||||
signature: 'config',
|
||||
description: 'see your current configuration',
|
||||
help: 'See your current Resin CLI configuration.\n\nConfiguration lives in $HOME/.resin/config.',
|
||||
action: function(params, options, done) {
|
||||
var key, ref, value;
|
||||
ref = settings.get();
|
||||
for (key in ref) {
|
||||
value = ref[key];
|
||||
console.log(key + ": " + value);
|
||||
}
|
||||
return done();
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
@ -64,6 +64,8 @@
|
||||
|
||||
capitano.command(actions.info.version);
|
||||
|
||||
capitano.command(actions.info.config);
|
||||
|
||||
capitano.command(actions.help.help);
|
||||
|
||||
capitano.command(actions.auth.login);
|
||||
|
@ -1,3 +1,4 @@
|
||||
settings = require('resin-settings-client')
|
||||
packageJSON = require('../../package.json')
|
||||
|
||||
exports.version =
|
||||
@ -9,3 +10,16 @@ exports.version =
|
||||
action: (params, options, done) ->
|
||||
console.log(packageJSON.version)
|
||||
return done()
|
||||
|
||||
exports.config =
|
||||
signature: 'config'
|
||||
description: 'see your current configuration'
|
||||
help: '''
|
||||
See your current Resin CLI configuration.
|
||||
|
||||
Configuration lives in $HOME/.resin/config.
|
||||
'''
|
||||
action: (params, options, done) ->
|
||||
for key, value of settings.get()
|
||||
console.log("#{key}: #{value}")
|
||||
return done()
|
||||
|
@ -47,6 +47,7 @@ capitano.globalOption
|
||||
|
||||
# ---------- Info Module ----------
|
||||
capitano.command(actions.info.version)
|
||||
capitano.command(actions.info.config)
|
||||
|
||||
# ---------- Help Module ----------
|
||||
capitano.command(actions.help.help)
|
||||
|
@ -66,7 +66,7 @@
|
||||
"resin-pine": "^1.1.1",
|
||||
"resin-register-device": "^1.0.1",
|
||||
"resin-sdk": "^1.7.4",
|
||||
"resin-settings-client": "^1.1.0",
|
||||
"resin-settings-client": "^1.2.0",
|
||||
"resin-vcs": "^1.2.0",
|
||||
"selfupdate": "^1.1.0",
|
||||
"tmp": "^0.0.25",
|
||||
|
Loading…
Reference in New Issue
Block a user