2021-10-21 16:18:58 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
const pkg = require('../package.json')
|
|
|
|
const path = require('path')
|
|
|
|
|
2021-10-21 20:49:49 +02:00
|
|
|
process.env.cwd = process.env.GANCIO_DATA || path.resolve('./')
|
2021-10-21 16:18:58 +02:00
|
|
|
|
|
|
|
process.chdir(path.resolve(__dirname, '..'))
|
|
|
|
|
|
|
|
async function start () {
|
|
|
|
require('@nuxt/cli-edge').run(['start', '--modern'])
|
|
|
|
.catch((error) => {
|
|
|
|
console.error(error)
|
|
|
|
process.exit(2)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2021-10-25 11:05:29 +02:00
|
|
|
console.info(`📅 ${pkg.name} - v${pkg.version} - ${pkg.description} (nodejs: ${process.version})`)
|
2021-10-21 16:18:58 +02:00
|
|
|
|
|
|
|
require('yargs')
|
|
|
|
.usage('Usage $0 <command> [options]')
|
|
|
|
.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(['start', 'run', '$0'], 'Start gancio', {}, start)
|
|
|
|
.help('h')
|
|
|
|
.alias('h', 'help')
|
|
|
|
.epilog('Made with ❤ by underscore hacklab - https://gancio.org')
|
|
|
|
.argv
|