MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / getCurrentVersion

Function getCurrentVersion

src/cli/updateCCB.ts:21–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19const PACKAGE_NAME = 'claude-code-best'
20
21function 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
35function isCommandAvailable(cmd: string): boolean {
36 try {

Callers 1

updateCCBFunction · 0.85

Calls 2

existsSyncFunction · 0.85
readFileSyncFunction · 0.50

Tested by

no test coverage detected