mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 23:42:03 +00:00
fix test
This commit is contained in:
parent
01133e1988
commit
3edcfc1cfd
1 changed files with 13 additions and 0 deletions
|
|
@ -19,6 +19,19 @@ import type { PromptPipelineContent } from './types.js';
|
|||
// mirroring the logic in the actual `escapeShellArg` implementation.
|
||||
function getExpectedEscapedArgForPlatform(arg: string): string {
|
||||
if (os.platform() === 'win32') {
|
||||
// Detect Git Bash / MSYS2 / MinTTY environments (same logic as getShellConfiguration)
|
||||
const msystem = process.env['MSYSTEM'];
|
||||
const term = process.env['TERM'] || '';
|
||||
const isGitBash =
|
||||
msystem?.startsWith('MINGW') ||
|
||||
msystem?.startsWith('MSYS') ||
|
||||
term.includes('msys') ||
|
||||
term.includes('cygwin');
|
||||
|
||||
if (isGitBash) {
|
||||
return quote([arg]);
|
||||
}
|
||||
|
||||
const comSpec = (process.env['ComSpec'] || 'cmd.exe').toLowerCase();
|
||||
const isPowerShell =
|
||||
comSpec.endsWith('powershell.exe') || comSpec.endsWith('pwsh.exe');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue