update add update
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { program, Command } from 'commander';
|
||||
import fs from 'fs';
|
||||
import { useContextKey } from '@kevisual/context'
|
||||
// 将多个子命令加入主程序中
|
||||
let version = '0.0.1';
|
||||
try {
|
||||
// @ts-ignore
|
||||
if (ENVISION_VERSION) version = ENVISION_VERSION;
|
||||
} catch (e) {}
|
||||
const version = useContextKey('version', () => {
|
||||
let version = '0.0.64';
|
||||
try {
|
||||
// @ts-ignore
|
||||
if (ENVISION_VERSION) version = ENVISION_VERSION;
|
||||
} catch (e) { }
|
||||
return version;
|
||||
})
|
||||
|
||||
// @ts-ignore
|
||||
program.name('app').description('A CLI tool with envison').version(version, '-V, --version');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user