mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 01:27:35 +00:00
* wip(omp): prove fresh settings overlay without redirecting storage * fix(omp): guard fresh launches with execution-host settings * fix(omp): preserve unmodelled shell launch commands * test(omp): consolidate shell fixture path import * preserve fresh OMP launch status * test: cover preserved OMP launch status * fix: recognize wrapped fresh OMP launches * chore(ci): refresh validation against fixed main baseline * fix(omp): recognize generated fresh launch guards across shells * fix(omp): preserve draft status and clear prefill across Unix shells * fix(omp): run cmd draft cleanup after either guard branch * fix(omp): launch drafts safely with nounset enabled * fix(omp): select draft shell without parser diagnostics * test(omp): await relay environment augmentation
19 lines
719 B
TypeScript
19 lines
719 B
TypeScript
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
import { join } from 'node:path'
|
|
import { OMP_FRESH_CONFIG_FILENAME, OMP_FRESH_CONFIG_SOURCE } from './omp-fresh-launch'
|
|
|
|
/** An empty path fails the launch guard without preventing unrelated terminal launches. */
|
|
export function materializeOmpFreshConfig(directory: string): string {
|
|
try {
|
|
const configPath = join(directory, OMP_FRESH_CONFIG_FILENAME)
|
|
if (existsSync(configPath) && readFileSync(configPath, 'utf8') === OMP_FRESH_CONFIG_SOURCE) {
|
|
return configPath
|
|
}
|
|
mkdirSync(directory, { recursive: true })
|
|
writeFileSync(configPath, OMP_FRESH_CONFIG_SOURCE)
|
|
return configPath
|
|
} catch {
|
|
return ''
|
|
}
|
|
}
|