mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 16:02:55 +00:00
* Add project Windows runtime selection * Fix project Windows runtime selection Co-authored-by: Orca <help@stably.ai> * fix: preserve WSL shell variables --------- Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com> Co-authored-by: Orca <help@stably.ai> Co-authored-by: Neil <neil@stably.ai>
18 lines
537 B
TypeScript
18 lines
537 B
TypeScript
import { createHash } from 'crypto'
|
|
import { join } from 'path'
|
|
|
|
export function relayTestSocketPath(dir: string, name = 'relay.sock'): string {
|
|
if (process.platform !== 'win32') {
|
|
return join(dir, name)
|
|
}
|
|
|
|
const suffix = createHash('sha256')
|
|
.update(`${process.pid}\0${dir}\0${name}`)
|
|
.digest('hex')
|
|
.slice(0, 20)
|
|
|
|
// Why: Node's net server requires Windows IPC endpoints to be named pipes;
|
|
// filesystem-style .sock paths fail with EACCES on Windows hosts.
|
|
return `\\\\.\\pipe\\orca-relay-test-${suffix}`
|
|
}
|