From ea8e59bc8bf7e97b72a89a65889e5da38a6445fa Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 13 Jul 2018 12:44:25 +0300 Subject: Implement command to list secret keys --- cli.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'cli.js') 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 ', `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 ', `${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 ', `Dequeue an NPM package installation on the host. NOTE: Does not uninstall already installed packages.`) + .command('package remove ', `${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); -- cgit v1.3