Files
orca/tests/e2e/terminal-node-command.ts
T
Neil c3a681f5b1 refactor: group process and platform modules by ownership (#42742)
* refactor: group process and platform modules by ownership

* refactor: preserve moved module workflow routing

* refactor: preserve native loader and embedded bundle origins
2026-11-15 07:23:28 -08:00

15 lines
726 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { quotePowerShellLiteral } from '../../src/shared/shell/launch/powershell-native-argument'
import { quotePosixShell } from '../../src/shared/shell/launch/shell-argument-quoting'
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
// Pin the runner’s Node executable because Windows CI shells may not inherit setup-node’s PATH.
return [executable, ...args.map(quoteTerminalArg)].join(' ')
}