fix(doctor): use actual installed clipproxy version instead of hardcoded

This commit is contained in:
kaitranntt
2025-12-04 03:19:01 -05:00
parent 5d5d62fac9
commit e3edcf613e
3 changed files with 21 additions and 3 deletions
+16
View File
@@ -900,4 +900,20 @@ export function getCLIProxyPath(): string {
return manager.getBinaryPath();
}
/**
* Get installed CLIProxyAPI version from .version file
* Returns the fallback version if not installed or version file missing
*/
export function getInstalledCliproxyVersion(): string {
const versionFile = path.join(getBinDir(), '.version');
if (fs.existsSync(versionFile)) {
try {
return fs.readFileSync(versionFile, 'utf8').trim();
} catch {
return CLIPROXY_FALLBACK_VERSION;
}
}
return CLIPROXY_FALLBACK_VERSION;
}
export default BinaryManager;