mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 04:02:21 +00:00
Merge pull request #328 from dnouri/fix/use-bash-on-unix
fix: Use bash instead of sh on Unix systems
This commit is contained in:
commit
04fa79ebe0
1 changed files with 9 additions and 2 deletions
|
|
@ -26,8 +26,9 @@ function findBashOnPath(): string | null {
|
||||||
* Get shell configuration based on platform.
|
* Get shell configuration based on platform.
|
||||||
* Resolution order:
|
* Resolution order:
|
||||||
* 1. User-specified shellPath in settings.json
|
* 1. User-specified shellPath in settings.json
|
||||||
* 2. On Windows: Git Bash in known locations
|
* 2. On Windows: Git Bash in known locations, then bash on PATH
|
||||||
* 3. Fallback: bash on PATH (Windows) or sh (Unix)
|
* 3. On Unix: /bin/bash
|
||||||
|
* 4. Fallback: sh
|
||||||
*/
|
*/
|
||||||
export function getShellConfig(): { shell: string; args: string[] } {
|
export function getShellConfig(): { shell: string; args: string[] } {
|
||||||
if (cachedShellConfig) {
|
if (cachedShellConfig) {
|
||||||
|
|
@ -83,6 +84,12 @@ export function getShellConfig(): { shell: string; args: string[] } {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unix: prefer bash over sh
|
||||||
|
if (existsSync("/bin/bash")) {
|
||||||
|
cachedShellConfig = { shell: "/bin/bash", args: ["-c"] };
|
||||||
|
return cachedShellConfig;
|
||||||
|
}
|
||||||
|
|
||||||
cachedShellConfig = { shell: "sh", args: ["-c"] };
|
cachedShellConfig = { shell: "sh", args: ["-c"] };
|
||||||
return cachedShellConfig;
|
return cachedShellConfig;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue