mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
* test: reproduce OpenCode plugin installation in the wrong config root * fix: install OpenCode hooks in the execution config directory * test: isolate config installation from CLI version probing * style: format consumer config installation controls * fix: use checked startup environment and supported relay shell context * fix: install OpenCode hooks using the selected execution shell * test(opencode): assert consumer config root in PTY fixtures --------- Co-authored-by: Codex <codex@openai.com> Co-authored-by: Orca <orca@stably.ai>
15 lines
536 B
TypeScript
15 lines
536 B
TypeScript
import { homedir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
|
|
/** OpenCode's Global.config follows XDG_CONFIG_HOME on every supported host. */
|
|
export function resolveOpenCodeConfigDirectory(
|
|
environment: NodeJS.ProcessEnv | Record<string, string> = process.env,
|
|
homeDirectory = homedir()
|
|
): string {
|
|
const executionHome = process.platform === 'win32' ? environment.USERPROFILE : environment.HOME
|
|
return join(
|
|
environment.XDG_CONFIG_HOME?.trim() || join(executionHome || homeDirectory, '.config'),
|
|
'opencode'
|
|
)
|
|
}
|