From 6757ae2dc6b9d0cdd5c058b185ddc7ff52c4db7e Mon Sep 17 00:00:00 2001 From: lesion Date: Thu, 5 May 2022 16:01:39 +0200 Subject: [PATCH] fix CLI management --- package.json | 6 +++--- server/cli.js | 18 ++++++++++-------- server/cli/accounts.js | 9 ++++----- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 4ecc2128..8b2425b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gancio", - "version": "1.4.3", + "version": "1.4.4-rc.1", "description": "A shared agenda for local communities", "author": "lesion", "scripts": { @@ -57,14 +57,14 @@ "multer": "^1.4.3", "nuxt-edge": "^2.16.0-27305297.ab1c6cb4", "pg": "^8.6.0", - "sequelize": "^6.19.0", + "sequelize": "^6.17.0", "sequelize-slugify": "^1.6.0", "sharp": "^0.27.2", "sqlite3": "mapbox/node-sqlite3#918052b", "tiptap": "^1.32.0", "tiptap-extensions": "^1.35.0", "umzug": "^2.3.0", - "v-calendar": "2.4.1", + "v-calendar": "^2.4.1", "vue": "^2.6.14", "vue-i18n": "^8.26.7", "vue-template-compiler": "^2.6.14", diff --git a/server/cli.js b/server/cli.js index fbc2d4b9..e12ae8d9 100755 --- a/server/cli.js +++ b/server/cli.js @@ -22,16 +22,18 @@ require('yargs') .option('config', { alias: 'c', describe: 'Configuration file', - default: path.resolve(process.env.cwd, 'config.json') - }) - .coerce('config', config_path => { - const absolute_config_path = path.resolve(process.env.cwd, config_path) - process.env.config_path = absolute_config_path - return absolute_config_path - }) - .command(['accounts'], 'Manage accounts', accountsCLI) + default: path.resolve(process.env.cwd, 'config.json'), + coerce: config_path => { + const absolute_config_path = path.resolve(process.env.cwd, config_path) + process.env.config_path = absolute_config_path + return absolute_config_path + }}) .command(['start', 'run', '$0'], 'Start gancio', {}, start) + .command(['accounts'], 'Manage accounts', accountsCLI) .help('h') .alias('h', 'help') .epilog('Made with ❤ by underscore hacklab - https://gancio.org') + .recommendCommands() + .strict() + .demandCommand(1, '') .argv diff --git a/server/cli/accounts.js b/server/cli/accounts.js index 94b0b97f..34231666 100644 --- a/server/cli/accounts.js +++ b/server/cli/accounts.js @@ -38,8 +38,7 @@ async function list () { console.log() } -const accountsCLI = yargs => { - return yargs +const accountsCLI = yargs => yargs .command('list', 'List all accounts', list) .command('modify', 'Modify', { account: { @@ -48,7 +47,7 @@ const accountsCLI = yargs => { demandOption: true }, 'reset-password': { - describe: 'Resets the password of the given accoun ', + describe: 'Resets the password of the given account ', type: 'boolean' } }, modify) @@ -56,6 +55,6 @@ const accountsCLI = yargs => { .recommendCommands() .strict() .demandCommand(1, '') -} + .argv -module.exports = accountsCLI +module.exports = accountsCLI \ No newline at end of file