mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-22 22:16:18 +08:00
chore: init project
This commit is contained in:
44
scripts/vsh/src/index.ts
Normal file
44
scripts/vsh/src/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { colors, consola } from '@vben/node-utils';
|
||||
import { cac } from 'cac';
|
||||
|
||||
import { defineCheckCircularCommand } from './check-circular';
|
||||
import { defineDepcheckCommand } from './check-dep';
|
||||
import { defineCleanCommand } from './clean';
|
||||
import { defineCodeWorkspaceCommand } from './code-workspace';
|
||||
import { defineLintCommand } from './lint';
|
||||
import { definePubLintCommand } from './publint';
|
||||
|
||||
try {
|
||||
const vsh = cac('vsh');
|
||||
|
||||
// vsh lint
|
||||
defineLintCommand(vsh);
|
||||
|
||||
// vsh publint
|
||||
definePubLintCommand(vsh);
|
||||
|
||||
// vsh clean
|
||||
defineCleanCommand(vsh);
|
||||
|
||||
// vsh code-workspace
|
||||
defineCodeWorkspaceCommand(vsh);
|
||||
|
||||
// vsh check-circular
|
||||
defineCheckCircularCommand(vsh);
|
||||
|
||||
// vsh check-dep
|
||||
defineDepcheckCommand(vsh);
|
||||
|
||||
// Invalid command
|
||||
vsh.on('command:*', () => {
|
||||
consola.error(colors.red('Invalid command!'));
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
vsh.usage('vsh');
|
||||
vsh.help();
|
||||
vsh.parse();
|
||||
} catch (error) {
|
||||
consola.error(error);
|
||||
process.exit(1);
|
||||
}
|
Reference in New Issue
Block a user