mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Created cli command. Updated tracker script.
This commit is contained in:
parent
49a55b40b4
commit
a6975ecedd
9 changed files with 120 additions and 35 deletions
25
cli/index.js
Normal file
25
cli/index.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
require('dotenv').config();
|
||||
const yargs = require('yargs');
|
||||
const chalk = require('chalk');
|
||||
const createAccount = require('./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();
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
exec();
|
||||
Loading…
Add table
Add a link
Reference in a new issue