Merge pull request #68 from resin-io/feature/config

Implement config command
This commit is contained in:
Juan Cruz Viotti 2015-06-11 07:57:31 -04:00
commit 73736abdea
5 changed files with 36 additions and 2 deletions

View File

@ -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);

View File

@ -64,6 +64,8 @@
capitano.command(actions.info.version);
capitano.command(actions.info.config);
capitano.command(actions.help.help);
capitano.command(actions.auth.login);

View File

@ -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()

View File

@ -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)

View File

@ -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",