mirror of
https://github.com/stablyai/orca.git
synced 2026-11-05 19:47:27 +00:00
17 lines
632 B
TypeScript
17 lines
632 B
TypeScript
import type { RemoteInstallTransport } from './remote-install-transport'
|
|
import { execCommand } from './ssh-relay-exec-command'
|
|
import type { RemoteHostPlatform } from './ssh-remote-platform'
|
|
|
|
export function execHostCommand(
|
|
conn: RemoteInstallTransport,
|
|
host: RemoteHostPlatform,
|
|
command: string,
|
|
options?: { signal?: AbortSignal; timeoutMs?: number; onStderr?: (stderr: string) => void }
|
|
): Promise<string> {
|
|
// Why the dialect, not the os: the wrapper is POSIX shell, so it follows the command dialect.
|
|
return execCommand(conn, command, {
|
|
wrapCommand: host.commandDialect !== 'powershell',
|
|
...options
|
|
})
|
|
}
|