Build cli using rollup.

This commit is contained in:
Mike Cao 2020-07-24 17:00:56 -07:00
parent 533ffbda13
commit 0f0b1e39e7
10 changed files with 175 additions and 23 deletions

View file

@ -1,8 +1,6 @@
const { PrismaClient } = require('@prisma/client');
import { prisma } from '../lib/db';
const prisma = new PrismaClient();
module.exports = async () => {
export default async () => {
const account = await prisma.account.findOne({
where: {
username: 'admin',

View file

@ -1,9 +1,9 @@
#!/usr/bin/env node
require('dotenv').config();
const yargs = require('yargs');
const chalk = require('chalk');
const createAccount = require('./create-account');
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');
@ -19,7 +19,9 @@ const exec = async () => {
cmd.showHelp();
}
process.exit(0);
console.log(chalk.green('Finished.'));
};
exec();
exec().then(() => {
process.exit(0);
});