Files
orca/tests/e2e/helpers/nested-runtime-proxy-jump-fixture.ts
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

35 lines
1.1 KiB
TypeScript

import { chmodSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
import os from 'node:os'
import path from 'node:path'
export type NestedRuntimeProxyJumpFixture = {
configPath: string
directory: string
wrapperPath: string
dispose(): void
writeConfig(contents: string): void
}
export function createNestedRuntimeProxyJumpFixture(): NestedRuntimeProxyJumpFixture {
const directory = mkdtempSync(path.join(os.tmpdir(), 'orca-e2e-proxy-jump-'))
const configPath = path.join(directory, 'ssh-config')
const wrapperPath = path.join(directory, 'ssh')
try {
// Why: OpenSSH ignores an overridden HOME on macOS, so force the disposable HUB-only config explicitly.
writeFileSync(wrapperPath, `#!/bin/sh\nexec /usr/bin/ssh -F "${configPath}" "$@"\n`, {
mode: 0o700
})
chmodSync(wrapperPath, 0o700)
} catch (error) {
rmSync(directory, { force: true, recursive: true })
throw error
}
return {
configPath,
directory,
wrapperPath,
dispose: () => rmSync(directory, { force: true, recursive: true }),
writeConfig: (contents) => writeFileSync(configPath, contents, { mode: 0o600 })
}
}