feat: migrated packages to ts
This commit is contained in:
31
packages/charword-table/runner.ts
Normal file
31
packages/charword-table/runner.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { build, update } from './index.ts'
|
||||
import { envParser, error } from '@aklive2d/libs'
|
||||
|
||||
async function main() {
|
||||
let err: string[] = []
|
||||
const { mode, name } = envParser.parse({
|
||||
mode: {
|
||||
type: 'string',
|
||||
short: 'm',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
short: 'n',
|
||||
multiple: true,
|
||||
default: [],
|
||||
},
|
||||
})
|
||||
switch (mode) {
|
||||
case 'build':
|
||||
err = await build(name as string[])
|
||||
break
|
||||
case 'update':
|
||||
await update()
|
||||
break
|
||||
default:
|
||||
throw new Error(`Unknown mode: ${mode}`)
|
||||
}
|
||||
error.handle(err)
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user