mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 08:52:12 +00:00
test: fix windows parallels agent quoting
This commit is contained in:
@@ -333,32 +333,22 @@ guest_run_openclaw() {
|
||||
local env_value="${2:-}"
|
||||
shift 2
|
||||
|
||||
local args_literal stdout_name stderr_name env_name_q env_value_q
|
||||
local args_literal env_name_q env_value_q
|
||||
args_literal="$(ps_array_literal "$@")"
|
||||
stdout_name="openclaw-stdout-$RANDOM-$RANDOM.log"
|
||||
stderr_name="openclaw-stderr-$RANDOM-$RANDOM.log"
|
||||
env_name_q="$(ps_single_quote "$env_name")"
|
||||
env_value_q="$(ps_single_quote "$env_value")"
|
||||
|
||||
guest_powershell "$(cat <<EOF
|
||||
\$stdout = Join-Path \$env:TEMP '$stdout_name'
|
||||
\$stderr = Join-Path \$env:TEMP '$stderr_name'
|
||||
try {
|
||||
if ('${env_name_q}' -ne '') {
|
||||
Set-Item -Path ('Env:' + '${env_name_q}') -Value '${env_value_q}'
|
||||
}
|
||||
\$proc = Start-Process -FilePath (Join-Path \$env:APPDATA 'npm\openclaw.cmd') -ArgumentList $args_literal -NoNewWindow -PassThru -RedirectStandardOutput \$stdout -RedirectStandardError \$stderr
|
||||
\$proc.WaitForExit()
|
||||
if (Test-Path \$stdout) {
|
||||
Get-Content \$stdout
|
||||
}
|
||||
if (Test-Path \$stderr) {
|
||||
Get-Content \$stderr
|
||||
}
|
||||
exit \$proc.ExitCode
|
||||
} finally {
|
||||
Remove-Item \$stdout, \$stderr -Force -ErrorAction SilentlyContinue
|
||||
\$openclaw = Join-Path \$env:APPDATA 'npm\openclaw.cmd'
|
||||
\$args = $args_literal
|
||||
if ('${env_name_q}' -ne '') {
|
||||
Set-Item -Path ('Env:' + '${env_name_q}') -Value '${env_value_q}'
|
||||
}
|
||||
\$output = & \$openclaw @args 2>&1
|
||||
if (\$null -ne \$output) {
|
||||
\$output | ForEach-Object { \$_ }
|
||||
}
|
||||
exit \$LASTEXITCODE
|
||||
EOF
|
||||
)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user