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

Method writeVersion

packages/config/src/migrations/runner.ts:37–47  ·  view source on GitHub ↗
(version: number)

Source from the content-addressed store, hash-verified

35 }
36
37 private writeVersion(version: number): void {
38 const versionPath = path.join(this.context.dataDir, VERSION_FILE)
39 try {
40 if (!fs.existsSync(this.context.dataDir)) {
41 fs.mkdirSync(this.context.dataDir, { recursive: true })
42 }
43 fs.writeFileSync(versionPath, String(version), 'utf-8')
44 } catch (err) {
45 this.context.logger.error('Migration', `Failed to write version file: ${err}`)
46 }
47 }
48
49 async run(): Promise<{ executed: number; currentVersion: number }> {
50 const currentVersion = this.getCurrentVersion()

Callers 1

runMethod · 0.95

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected