update add update

This commit is contained in:
2025-11-28 02:49:52 +08:00
parent 01c253e553
commit b2fcc84321
10 changed files with 162 additions and 81 deletions

View File

@@ -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');