mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 05:03:26 +00:00
fix(coding-agent): use dynamic paths in error messages (#887)
Error messages for missing credentials and shell config now use getAuthPath() and getSettingsPath() instead of hardcoded ~/.pi/agent/ paths, so they correctly reflect PI_CODING_AGENT_DIR when set.
This commit is contained in:
parent
620239bd3f
commit
69d02b8a5f
3 changed files with 6 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { existsSync } from "node:fs";
|
||||
import { spawn, spawnSync } from "child_process";
|
||||
import { getSettingsPath } from "../config.js";
|
||||
import { SettingsManager } from "../core/settings-manager.js";
|
||||
|
||||
let cachedShellConfig: { shell: string; args: string[] } | null = null;
|
||||
|
|
@ -45,7 +46,7 @@ export function getShellConfig(): { shell: string; args: string[] } {
|
|||
return cachedShellConfig;
|
||||
}
|
||||
throw new Error(
|
||||
`Custom shell path not found: ${customShellPath}\nPlease update shellPath in ~/.pi/agent/settings.json`,
|
||||
`Custom shell path not found: ${customShellPath}\nPlease update shellPath in ${getSettingsPath()}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +80,7 @@ export function getShellConfig(): { shell: string; args: string[] } {
|
|||
`No bash shell found. Options:\n` +
|
||||
` 1. Install Git for Windows: https://git-scm.com/download/win\n` +
|
||||
` 2. Add your bash to PATH (Cygwin, MSYS2, etc.)\n` +
|
||||
` 3. Set shellPath in ~/.pi/agent/settings.json\n\n` +
|
||||
` 3. Set shellPath in ${getSettingsPath()}\n\n` +
|
||||
`Searched Git Bash in:\n${paths.map((p) => ` ${p}`).join("\n")}`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue