(userDataDir: string)
| 12 | } |
| 13 | |
| 14 | function writeIncompatibleMeta(userDataDir: string): void { |
| 15 | fs.mkdirSync(userDataDir, { recursive: true }) |
| 16 | fs.writeFileSync( |
| 17 | path.join(userDataDir, '.chatlab-meta.json'), |
| 18 | JSON.stringify({ |
| 19 | formatVersion: 1, |
| 20 | minRuntimeVersion: '999.0.0', |
| 21 | dataCompatibilityVersion: 1, |
| 22 | reasons: ['segment-schema'], |
| 23 | updatedBy: { runtime: 'desktop', module: 'chat-db-migration', version: '999.0.0' }, |
| 24 | updatedAt: 1780830000, |
| 25 | }), |
| 26 | 'utf-8' |
| 27 | ) |
| 28 | } |
| 29 | |
| 30 | async function withDataDirEnv<T>(userDataDir: string, fn: () => Promise<T> | T): Promise<T> { |
| 31 | const previousDataDir = process.env.CHATLAB_DATA_DIR |
no outgoing calls
no test coverage detected