aboutsummaryrefslogtreecommitdiffstats
path: root/cli.js
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@eficode.com>2018-07-13 12:44:25 +0300
committerJan Tuomi <jan.tuomi@eficode.com>2018-07-13 12:44:25 +0300
commitea8e59bc8bf7e97b72a89a65889e5da38a6445fa (patch)
treeabf07df68d9d61a6d5c73b384093679ca0984d79 /cli.js
parenta69b3b644a9275e43a3832ed9cf3ccfbda336189 (diff)
Implement command to list secret keysmaster
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js28
1 files changed, 25 insertions, 3 deletions
diff --git a/cli.js b/cli.js
index 0435317..f650c73 100755
--- a/cli.js
+++ b/cli.js
@@ -279,7 +279,29 @@ vorpal
});
vorpal
- .command('package add <package>', `Enqueue an NPM package installation on the host.`)
+ .command('secret list', 'List secret keys.')
+ .action(async function (args, callback) {
+ try {
+ await checkConnection(mongoURL, this);
+ } catch (err) {
+ showMongoNotSetError(vorpal);
+ return callback();
+ }
+
+ try {
+ const secretObjects = await models.secrets.find({});
+ secretObjects.forEach(secret => {
+ this.log(secret.key);
+ });
+ } catch (err) {
+ this.log(chalk.red(`Failed to list secrets!`));
+ this.log(chalk.red(String(err)));
+ }
+ callback();
+ });
+
+vorpal
+ .command('package add <package>', `${chalk.yellow('(Not implemented)')} Enqueue an NPM package installation on the host.`)
.action(async function (args, callback) {
try {
await checkConnection(mongoURL, this);
@@ -307,7 +329,7 @@ vorpal
});
vorpal
- .command('package remove <package>', `Dequeue an NPM package installation on the host. NOTE: Does not uninstall already installed packages.`)
+ .command('package remove <package>', `${chalk.yellow('(Not implemented)')} Dequeue an NPM package installation on the host. NOTE: Does not uninstall already installed packages.`)
.action(async function (args, callback) {
try {
await checkConnection(mongoURL, this);
@@ -337,7 +359,7 @@ vorpal
});
vorpal
- .command('package list', `List NPM packages in the installation queue.`)
+ .command('package list', `${chalk.yellow('(Not implemented)')} List NPM packages in the installation queue.`)
.action(async function (args, callback) {
try {
await checkConnection(mongoURL, this);