mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
* refactor(ssh): split ssh-connection-utils into concretely named modules - classifiers -> ssh-reconnect-error-classification.ts - retry/timeout constants and sleep -> connection/ssh-connection-timing.ts - buildConnectConfig -> connection/ssh-connect-config.ts - credential callbacks -> connection/ssh-connection-callbacks.ts - exec options and abort error -> connection/ssh-exec-options.ts - wrapRemoteCommandForPosixShell -> ssh-posix-command-wrapper.ts - shellEscape and shared/wsl-login-shell-command quotePosixShell (identical) -> shared/shell-argument-quoting.ts quotePosixShell No re-exports are left behind. Co-Authored-By: Claude <noreply@anthropic.com> * fix: point the WSL git benchmark and the WSL lane route at shell-argument-quoting Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
16 lines
745 B
TypeScript
16 lines
745 B
TypeScript
import { quotePowerShellLiteral } from '../../src/shared/powershell-native-argument'
|
|
import { quotePosixShell } from '../../src/shared/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
|
|
|
|
// 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(' ')
|
|
}
|