feat: migrated packages to ts
This commit is contained in:
28
apps/directory/runner.ts
Normal file
28
apps/directory/runner.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import path from 'node:path'
|
||||
import { DIST_DIR } from '@aklive2d/showcase'
|
||||
import { build as viteBuild } from 'vite'
|
||||
import { envParser, file } from '@aklive2d/libs'
|
||||
|
||||
const build = async (namesToBuild: string[]) => {
|
||||
if (!namesToBuild.length) {
|
||||
// skip as directory can only build
|
||||
// when all operators are built
|
||||
await viteBuild()
|
||||
const releaseDir = path.resolve(DIST_DIR)
|
||||
file.rmdir(releaseDir)
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const { name } = envParser.parse({
|
||||
name: {
|
||||
type: 'string',
|
||||
short: 'n',
|
||||
multiple: true,
|
||||
default: [],
|
||||
},
|
||||
})
|
||||
await build(name as string[])
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user