Files
orca/tests/e2e/terminal-node-command.ts
T
OrcaWinandm4air bdc0921718 test(e2e): one posixShellQuote; docker-ssh-host fixture names (Phase 3.99 0.11b) (#27449)
* test(e2e): one posixShellQuote; docker-ssh-host fixture names

* test(e2e): leave the main-failing stall-recovery spec untouched

---------

Co-authored-by: m4air <m4air@Mac.localdomain>
2026-10-11 05:15:31 -07:00

16 lines
746 B
TypeScript

import { quotePowerShellLiteral } from '../../src/shared/powershell-native-argument'
import { quotePosixShell } from '../../src/shared/wsl-login-shell-command'
function quoteTerminalArg(value: string): string {
return process.platform === 'win32' ? quotePowerShellLiteral(value) : quotePosixShell(value)
}
export function nodeTerminalCommand(args: readonly string[]): string {
const nodeExecutable = quoteTerminalArg(process.execPath)
const executable = process.platform === 'win32' ? `& ${nodeExecutable}` : nodeExecutable
// Why: Windows CI shells do not always inherit setup-node's PATH, so E2E
// terminal probes must invoke the runner's Node executable directly.
return [executable, ...args.map(quoteTerminalArg)].join(' ')
}