fix(codex): qualify git bash rerun guidance

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Woonggi Min
2026-05-31 15:29:02 +09:00
parent 0073d38073
commit e260048b36
3 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ describe("git-bash", () => {
expect(result.checkedPaths).toEqual([PROGRAM_FILES_GIT_BASH, PROGRAM_FILES_X86_GIT_BASH])
expect(result.installHint).toContain("winget install --id Git.Git -e --source winget")
expect(result.installHint).toContain("OMO_CODEX_GIT_BASH_PATH=C:\\path\\to\\bash.exe")
expect(result.installHint).toContain("rerun `bunx omo install --platform=codex`")
expect(result.installHint).toContain("rerun `bunx --package oh-my-openagent omo install --platform=codex`")
})
test("#given Windows without Git Bash and winget is allowed #when preparing #then winget runs and resolver is retried", async () => {
+1 -1
View File
@@ -100,7 +100,7 @@ function missingGitBash(checkedPaths: readonly string[]): GitBashResolution {
"Git Bash is required for native Windows Codex profile installs.",
"Install it with: winget install --id Git.Git -e --source winget",
`For a custom install, set ${GIT_BASH_ENV_KEY}=C:\\path\\to\\bash.exe`,
"Then rerun `bunx omo install --platform=codex`.",
"Then rerun `bunx --package oh-my-openagent omo install --platform=codex`.",
].join("\n"),
}
}
@@ -52,7 +52,7 @@ describe("install-codex Git Bash preflight", () => {
"Git Bash is required.",
"winget install --id Git.Git -e --source winget",
"OMO_CODEX_GIT_BASH_PATH=C:\\path\\to\\bash.exe",
"rerun `bunx omo install --platform=codex`",
"rerun `bunx --package oh-my-openagent omo install --platform=codex`",
].join("\n"),
}),
runCommand: async (command: string, args: readonly string[], options: CommandRunOptions) => {
@@ -61,9 +61,23 @@ describe("install-codex Git Bash preflight", () => {
})
// then
await expect(install).rejects.toThrow("winget install --id Git.Git -e --source winget")
let installError: unknown
try {
await install
} catch (error) {
installError = error
}
expect(installError).toBeInstanceOf(Error)
expect((installError as Error).message).toContain("winget install --id Git.Git -e --source winget")
expect(commands).toEqual([])
await expect(stat(join(codexHome, "config.toml"))).rejects.toThrow()
let configStatError: unknown
try {
await stat(join(codexHome, "config.toml"))
} catch (error) {
configStatError = error
}
expect(configStatError).toBeInstanceOf(Error)
})
test("#given Windows without Git Bash #when winget succeeds and resolver recovers #then install continues", async () => {