MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / guestPlan

Function guestPlan

e2e/setup/cli.globalsetup.ts:21–48  ·  view source on GitHub ↗
(os: VmOs)

Source from the content-addressed store, hash-verified

19// Per-OS guest specifics: working dir, binary name, and the shell idioms for
20// prep/cleanup — Unix `sh` on tart (macOS/Linux), PowerShell on EC2 Windows.
21const guestPlan = (os: VmOs) => {
22 if (os === "windows") {
23 const dir = "C:/ed";
24 const exe = `${dir}/executor.exe`;
25 return {
26 dir,
27 prep: `Remove-Item -Recurse -Force '${dir}' -ErrorAction SilentlyContinue; New-Item -ItemType Directory -Force -Path '${dir}' | Out-Null`,
28 postPush: "Write-Output ok", // no chmod/quarantine on Windows
29 install: `& '${exe}' service install --port ${PORT}`,
30 readToken: 'Get-Content "$env:USERPROFILE\\.executor\\server-control\\auth.json" -Raw',
31 uninstall: `& '${exe}' service uninstall`,
32 };
33 }
34 const dir = "~/ed";
35 const exe = `${dir}/executor`;
36 return {
37 dir,
38 prep: `rm -rf ${dir} && mkdir -p ${dir}`,
39 // macOS quarantines scp'd executables; clear it so the binary can run.
40 postPush:
41 os === "macos"
42 ? `chmod +x ${exe}; xattr -dr com.apple.quarantine ${dir} 2>/dev/null || true`
43 : `chmod +x ${exe}`,
44 install: `${exe} service install --port ${PORT}`,
45 readToken: "cat ~/.executor/server-control/auth.json",
46 uninstall: `${exe} service uninstall`,
47 };
48};
49
50export async function setupCliTarget(os: VmOs): Promise<(() => Promise<void>) | void> {
51 process.env.E2E_VM_OS = os; // so the worker-side target resolves the same OS

Callers 1

setupCliTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected