umami/cli/index.js

28 lines
513 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
2020-07-25 02:00:56 +02:00
import 'dotenv/config';
import yargs from 'yargs';
import chalk from 'chalk';
import createAccount from './create-account';
const cmd = yargs.usage('Usage: umami <command> [arguments]').help('h').alias('h', 'help');
const { argv } = cmd;
const {
_: [action, ...params],
} = argv;
const exec = async () => {
if (action === 'create') {
await createAccount();
} else {
cmd.showHelp();
}
2020-07-25 02:00:56 +02:00
console.log(chalk.green('Finished.'));
};
2020-07-25 02:00:56 +02:00
exec().then(() => {
process.exit(0);
});