theme-utils: Fix for fish shell (#7398)
This commit is contained in:
parent
042cf39083
commit
20ba82f842
1 changed files with 11 additions and 1 deletions
|
@ -1099,7 +1099,17 @@ export async function executeCommand(command, logResponse) {
|
|||
detached: true,
|
||||
})
|
||||
} else {
|
||||
child = spawn(process.env.SHELL, ['-c', command], {
|
||||
/*
|
||||
* Determines the shell to execute the command.
|
||||
* - Prioritizes using the user's default shell unless it's fish, a known problematic shell.
|
||||
* - In this case, falls back to `/bin/bash` for better syntax compatibility.
|
||||
*/
|
||||
let shellPath = process.env.SHELL || '/bin/bash';
|
||||
if (shellPath.includes('fish') && fs.existsSync('/bin/bash')) {
|
||||
shellPath = '/bin/bash';
|
||||
}
|
||||
|
||||
child = spawn(shellPath, ['-c', command], {
|
||||
stdio: [process.stdin, 'pipe', 'pipe'],
|
||||
detached: true,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue