feat: Support multiple application launch scripts

This commit is contained in:
vben
2024-07-31 00:29:15 +08:00
parent fdee2d2239
commit a26630b6e0
18 changed files with 204 additions and 24 deletions

View File

@@ -0,0 +1,29 @@
import { colors, consola } from '@vben/node-utils';
import { cac } from 'cac';
import { run } from './run';
try {
const turboRun = cac('turbo-run');
turboRun
.command('[script]')
.usage(`Run turbo interactively.`)
.action(async (command: string) => {
run({ command });
});
// Invalid command
turboRun.on('command:*', () => {
consola.error(colors.red('Invalid command!'));
process.exit(1);
});
turboRun.usage('turbo-run');
turboRun.help();
turboRun.parse();
} catch (error) {
consola.error(error);
process.exit(1);
}