()
| 19 | const PACKAGE_NAME = 'claude-code-best' |
| 20 | |
| 21 | function getCurrentVersion(): string { |
| 22 | // Read version from the nearest package.json (walks up from dist root) |
| 23 | try { |
| 24 | const pkgPath = join(distRoot, '..', 'package.json') |
| 25 | if (existsSync(pkgPath)) { |
| 26 | const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')) |
| 27 | if (pkg.version) return pkg.version |
| 28 | } |
| 29 | } catch { |
| 30 | // fallback |
| 31 | } |
| 32 | return MACRO.VERSION |
| 33 | } |
| 34 | |
| 35 | function isCommandAvailable(cmd: string): boolean { |
| 36 | try { |
no test coverage detected