This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-cli/src/index.ts

52 lines
1.1 KiB
TypeScript
Raw Normal View History

#!/usr/bin/env node
import commander from "commander"
2021-02-05 16:35:52 +08:00
import { build, clean } from "./actions";
2021-08-04 15:32:19 +08:00
import { create, createLib } from "./create"
2021-02-05 18:20:42 +08:00
import dev from "./dev"
2021-02-25 17:03:49 +08:00
import { run } from "./run";
(process.env.FORCE_COLOR as any) = true
commander
.command('create <name>')
.action(async function (name, cmd) {
await create(name);
})
2021-08-04 15:32:19 +08:00
commander
.command('createLib <name>')
.action(async function (name, cmd) {
await createLib(name);
})
commander
.command('new <name>')
.action(async function (name, cmd) {
await create(name);
})
commander
.command('dev')
2021-02-05 18:20:42 +08:00
.action(async function () {
await dev()
})
commander
.command('build')
2021-02-05 16:35:52 +08:00
.action(async function () {
2021-03-26 14:50:00 +08:00
const ret = await build();
if (ret != 0) {
process.exit(ret)
}
})
commander
.command('clean')
2021-02-05 16:35:52 +08:00
.action(async function () {
await clean();
})
2021-02-25 17:03:49 +08:00
commander
.command('run <platform>')
.action(async function (platform, cmd) {
await run(platform);
})
commander.parse(process.argv)
2021-02-25 17:03:49 +08:00