This commit is contained in:
2026-03-10 16:53:06 +00:00
parent c4c2caa6f0
commit d8ee723dae
8 changed files with 83 additions and 29 deletions
+6 -12
View File
@@ -1,7 +1,4 @@
import { exec, execSync, type ExecSyncOptions } from "child_process";
import grabSSHPrefix from "./grab-ssh-prefix";
import { writeFileSync } from "fs";
import { TCIConfig } from "../types";
import turboCIPkgrabDirNames from "./turboci-pkg-grab-dir-names";
type Param = {
@@ -28,13 +25,10 @@ export default async function relayExecSSH({
bun,
}: Param): Promise<string | undefined> {
try {
const {
relayServerBunScriptsDir,
relayServerBunScriptFile,
relayShExecFile,
} = turboCIPkgrabDirNames();
const { relayServerBunScriptsDir, relayServerBunScriptFile } =
turboCIPkgrabDirNames();
let relaySh = `#!/bin/bash\n`;
let relaySh = `\n`;
const parsedCmd =
typeof cmd == "string"
@@ -75,10 +69,10 @@ export default async function relayExecSSH({
console.log("====================================================");
}
writeFileSync(relayShExecFile, relaySh);
let relayCmd = ``;
relayCmd += `chmod +x ${relayShExecFile} && /bin/bash ${relayShExecFile}\n`;
relayCmd += `/bin/bash << 'EOF'\n`;
relayCmd += `${relaySh}\n`;
relayCmd += `EOF\n`;
if (detached) {
exec(relayCmd);