MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / getCurrentVersion

Method getCurrentVersion

packages/config/src/migrations/runner.ts:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 }
22
23 getCurrentVersion(): number {
24 const versionPath = path.join(this.context.dataDir, VERSION_FILE)
25 try {
26 if (fs.existsSync(versionPath)) {
27 const raw = fs.readFileSync(versionPath, 'utf-8').trim()
28 const ver = parseInt(raw, 10)
29 return Number.isFinite(ver) ? ver : 0
30 }
31 } catch {
32 // version file unreadable, treat as 0
33 }
34 return 0
35 }
36
37 private writeVersion(version: number): void {
38 const versionPath = path.join(this.context.dataDir, VERSION_FILE)

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected