feat: add update
This commit is contained in:
parent
4e007d48a4
commit
2e0d8a0581
16
src/command/update.ts
Normal file
16
src/command/update.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { program, Command } from '@/program.ts';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
const update = new Command('update')
|
||||
.option('-g --global', 'update global')
|
||||
.description('update cli')
|
||||
.action((opts) => {
|
||||
try {
|
||||
const cmd = opts.global ? 'npm install -g @kevisual/envision-cli' : 'npm install -D @kevisual/envision-cli';
|
||||
execSync(cmd, { stdio: 'inherit', encoding: 'utf-8' });
|
||||
} catch (error) {
|
||||
console.error('Error updating CLI:', error);
|
||||
}
|
||||
});
|
||||
|
||||
program.addCommand(update);
|
@ -8,6 +8,8 @@ import './command/npm.ts';
|
||||
import './command/publish.ts';
|
||||
import './command/init.ts';
|
||||
import './command/proxy.ts';
|
||||
import './command/update.ts';
|
||||
|
||||
import './command/sync/sync.ts';
|
||||
|
||||
import './command/app/index.ts';
|
||||
|
Loading…
x
Reference in New Issue
Block a user