fix CLI management

This commit is contained in:
lesion 2022-05-05 16:01:39 +02:00
parent 282b638928
commit 6757ae2dc6
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 17 additions and 16 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "gancio", "name": "gancio",
"version": "1.4.3", "version": "1.4.4-rc.1",
"description": "A shared agenda for local communities", "description": "A shared agenda for local communities",
"author": "lesion", "author": "lesion",
"scripts": { "scripts": {
@ -57,14 +57,14 @@
"multer": "^1.4.3", "multer": "^1.4.3",
"nuxt-edge": "^2.16.0-27305297.ab1c6cb4", "nuxt-edge": "^2.16.0-27305297.ab1c6cb4",
"pg": "^8.6.0", "pg": "^8.6.0",
"sequelize": "^6.19.0", "sequelize": "^6.17.0",
"sequelize-slugify": "^1.6.0", "sequelize-slugify": "^1.6.0",
"sharp": "^0.27.2", "sharp": "^0.27.2",
"sqlite3": "mapbox/node-sqlite3#918052b", "sqlite3": "mapbox/node-sqlite3#918052b",
"tiptap": "^1.32.0", "tiptap": "^1.32.0",
"tiptap-extensions": "^1.35.0", "tiptap-extensions": "^1.35.0",
"umzug": "^2.3.0", "umzug": "^2.3.0",
"v-calendar": "2.4.1", "v-calendar": "^2.4.1",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-i18n": "^8.26.7", "vue-i18n": "^8.26.7",
"vue-template-compiler": "^2.6.14", "vue-template-compiler": "^2.6.14",

View file

@ -22,16 +22,18 @@ require('yargs')
.option('config', { .option('config', {
alias: 'c', alias: 'c',
describe: 'Configuration file', describe: 'Configuration file',
default: path.resolve(process.env.cwd, 'config.json') default: path.resolve(process.env.cwd, 'config.json'),
}) coerce: config_path => {
.coerce('config', config_path => { const absolute_config_path = path.resolve(process.env.cwd, config_path)
const absolute_config_path = path.resolve(process.env.cwd, config_path) process.env.config_path = absolute_config_path
process.env.config_path = absolute_config_path return absolute_config_path
return absolute_config_path }})
})
.command(['accounts'], 'Manage accounts', accountsCLI)
.command(['start', 'run', '$0'], 'Start gancio', {}, start) .command(['start', 'run', '$0'], 'Start gancio', {}, start)
.command(['accounts'], 'Manage accounts', accountsCLI)
.help('h') .help('h')
.alias('h', 'help') .alias('h', 'help')
.epilog('Made with ❤ by underscore hacklab - https://gancio.org') .epilog('Made with ❤ by underscore hacklab - https://gancio.org')
.recommendCommands()
.strict()
.demandCommand(1, '')
.argv .argv

View file

@ -38,8 +38,7 @@ async function list () {
console.log() console.log()
} }
const accountsCLI = yargs => { const accountsCLI = yargs => yargs
return yargs
.command('list', 'List all accounts', list) .command('list', 'List all accounts', list)
.command('modify', 'Modify', { .command('modify', 'Modify', {
account: { account: {
@ -48,7 +47,7 @@ const accountsCLI = yargs => {
demandOption: true demandOption: true
}, },
'reset-password': { 'reset-password': {
describe: 'Resets the password of the given accoun ', describe: 'Resets the password of the given account ',
type: 'boolean' type: 'boolean'
} }
}, modify) }, modify)
@ -56,6 +55,6 @@ const accountsCLI = yargs => {
.recommendCommands() .recommendCommands()
.strict() .strict()
.demandCommand(1, '') .demandCommand(1, '')
} .argv
module.exports = accountsCLI module.exports = accountsCLI