mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
Implement settings command
This command allows the user to list all detected settings.
This commit is contained in:
parent
d079a57da4
commit
f52dd2976f
@ -11,6 +11,7 @@
|
||||
notes: require('./notes'),
|
||||
help: require('./help'),
|
||||
os: require('./os'),
|
||||
settings: require('./settings'),
|
||||
config: require('./config')
|
||||
};
|
||||
|
||||
|
17
build/actions/settings.js
Normal file
17
build/actions/settings.js
Normal file
@ -0,0 +1,17 @@
|
||||
(function() {
|
||||
var prettyjson, resin;
|
||||
|
||||
resin = require('resin-sdk');
|
||||
|
||||
prettyjson = require('prettyjson');
|
||||
|
||||
exports.list = {
|
||||
signature: 'settings',
|
||||
description: 'print current settings',
|
||||
help: 'Use this command to display detected settings\n\nExamples:\n\n $ resin settings',
|
||||
action: function(params, options, done) {
|
||||
return resin.settings.getAll().then(prettyjson.render).then(console.log).nodeify(done);
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
@ -104,6 +104,8 @@
|
||||
|
||||
capitano.command(actions.config.reconfigure);
|
||||
|
||||
capitano.command(actions.settings.list);
|
||||
|
||||
capitano.command(actions.logs);
|
||||
|
||||
update.notify();
|
||||
|
@ -68,6 +68,12 @@
|
||||
"lib/actions/config.coffee"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Settings",
|
||||
"files": [
|
||||
"lib/actions/settings.coffee"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Wizard",
|
||||
"files": [
|
||||
|
@ -82,6 +82,10 @@ Now you have access to all the commands referenced below.
|
||||
- [config write <key> <value>](#config-write-60-key-62-60-value-62-)
|
||||
- [config reconfigure](#config-reconfigure)
|
||||
|
||||
- Settings
|
||||
|
||||
- [settings](#settings)
|
||||
|
||||
- Wizard
|
||||
|
||||
- [quickstart [name]](#quickstart-name-)
|
||||
@ -670,6 +674,16 @@ drive
|
||||
|
||||
show advanced commands
|
||||
|
||||
# Settings
|
||||
|
||||
## settings
|
||||
|
||||
Use this command to display detected settings
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin settings
|
||||
|
||||
# Wizard
|
||||
|
||||
## quickstart [name]
|
||||
|
@ -10,4 +10,5 @@ module.exports =
|
||||
notes: require('./notes')
|
||||
help: require('./help')
|
||||
os: require('./os')
|
||||
settings: require('./settings')
|
||||
config: require('./config')
|
||||
|
18
lib/actions/settings.coffee
Normal file
18
lib/actions/settings.coffee
Normal file
@ -0,0 +1,18 @@
|
||||
resin = require('resin-sdk')
|
||||
prettyjson = require('prettyjson')
|
||||
|
||||
exports.list =
|
||||
signature: 'settings'
|
||||
description: 'print current settings'
|
||||
help: '''
|
||||
Use this command to display detected settings
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin settings
|
||||
'''
|
||||
action: (params, options, done) ->
|
||||
resin.settings.getAll()
|
||||
.then(prettyjson.render)
|
||||
.then(console.log)
|
||||
.nodeify(done)
|
@ -75,6 +75,9 @@ capitano.command(actions.config.read)
|
||||
capitano.command(actions.config.write)
|
||||
capitano.command(actions.config.reconfigure)
|
||||
|
||||
# ---------- Settings Module ----------
|
||||
capitano.command(actions.settings.list)
|
||||
|
||||
# ---------- Logs Module ----------
|
||||
capitano.command(actions.logs)
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
||||
"resin-image": "^1.1.4",
|
||||
"resin-image-manager": "^3.2.2",
|
||||
"resin-pine": "^1.3.0",
|
||||
"resin-sdk": "^4.1.1",
|
||||
"resin-sdk": "^4.1.2",
|
||||
"resin-settings-client": "^3.1.0",
|
||||
"resin-vcs": "^2.0.0",
|
||||
"rimraf": "^2.4.3",
|
||||
|
Loading…
Reference in New Issue
Block a user