mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-03-10 22:44:14 +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'),
|
notes: require('./notes'),
|
||||||
help: require('./help'),
|
help: require('./help'),
|
||||||
os: require('./os'),
|
os: require('./os'),
|
||||||
|
settings: require('./settings'),
|
||||||
config: require('./config')
|
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.config.reconfigure);
|
||||||
|
|
||||||
|
capitano.command(actions.settings.list);
|
||||||
|
|
||||||
capitano.command(actions.logs);
|
capitano.command(actions.logs);
|
||||||
|
|
||||||
update.notify();
|
update.notify();
|
||||||
|
@ -68,6 +68,12 @@
|
|||||||
"lib/actions/config.coffee"
|
"lib/actions/config.coffee"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"title": "Settings",
|
||||||
|
"files": [
|
||||||
|
"lib/actions/settings.coffee"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"title": "Wizard",
|
"title": "Wizard",
|
||||||
"files": [
|
"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 write <key> <value>](#config-write-60-key-62-60-value-62-)
|
||||||
- [config reconfigure](#config-reconfigure)
|
- [config reconfigure](#config-reconfigure)
|
||||||
|
|
||||||
|
- Settings
|
||||||
|
|
||||||
|
- [settings](#settings)
|
||||||
|
|
||||||
- Wizard
|
- Wizard
|
||||||
|
|
||||||
- [quickstart [name]](#quickstart-name-)
|
- [quickstart [name]](#quickstart-name-)
|
||||||
@ -670,6 +674,16 @@ drive
|
|||||||
|
|
||||||
show advanced commands
|
show advanced commands
|
||||||
|
|
||||||
|
# Settings
|
||||||
|
|
||||||
|
## settings
|
||||||
|
|
||||||
|
Use this command to display detected settings
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
$ resin settings
|
||||||
|
|
||||||
# Wizard
|
# Wizard
|
||||||
|
|
||||||
## quickstart [name]
|
## quickstart [name]
|
||||||
|
@ -10,4 +10,5 @@ module.exports =
|
|||||||
notes: require('./notes')
|
notes: require('./notes')
|
||||||
help: require('./help')
|
help: require('./help')
|
||||||
os: require('./os')
|
os: require('./os')
|
||||||
|
settings: require('./settings')
|
||||||
config: require('./config')
|
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.write)
|
||||||
capitano.command(actions.config.reconfigure)
|
capitano.command(actions.config.reconfigure)
|
||||||
|
|
||||||
|
# ---------- Settings Module ----------
|
||||||
|
capitano.command(actions.settings.list)
|
||||||
|
|
||||||
# ---------- Logs Module ----------
|
# ---------- Logs Module ----------
|
||||||
capitano.command(actions.logs)
|
capitano.command(actions.logs)
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
"resin-image": "^1.1.4",
|
"resin-image": "^1.1.4",
|
||||||
"resin-image-manager": "^3.2.2",
|
"resin-image-manager": "^3.2.2",
|
||||||
"resin-pine": "^1.3.0",
|
"resin-pine": "^1.3.0",
|
||||||
"resin-sdk": "^4.1.1",
|
"resin-sdk": "^4.1.2",
|
||||||
"resin-settings-client": "^3.1.0",
|
"resin-settings-client": "^3.1.0",
|
||||||
"resin-vcs": "^2.0.0",
|
"resin-vcs": "^2.0.0",
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user