mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
refactor: remove dead runServerCapture from all cloud modules (#2325)
The runServerCapture function was defined in aws, hetzner, gcp, and digitalocean modules but never called anywhere in the codebase. All cloud modules use runServer (which streams to stderr) and the CloudRunner interface only requires runServer, not runServerCapture. Bump CLI version 0.15.14 → 0.15.15. Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a215848cac
commit
fedd024801
4 changed files with 0 additions and 157 deletions
|
|
@ -1134,43 +1134,6 @@ export async function runServer(cmd: string, timeoutSecs?: number): Promise<void
|
|||
}
|
||||
}
|
||||
|
||||
export async function runServerCapture(cmd: string, timeoutSecs?: number): Promise<string> {
|
||||
const fullCmd = `export PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
|
||||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
const proc = Bun.spawn(
|
||||
[
|
||||
"ssh",
|
||||
...SSH_BASE_OPTS,
|
||||
...keyOpts,
|
||||
`${SSH_USER}@${_state.instanceIp}`,
|
||||
`bash -c '${fullCmd.replace(/'/g, "'\\''")}'`,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"pipe",
|
||||
"pipe",
|
||||
],
|
||||
},
|
||||
);
|
||||
const timeout = (timeoutSecs || 300) * 1000;
|
||||
const timer = setTimeout(() => killWithTimeout(proc), timeout);
|
||||
try {
|
||||
// Drain both pipes before awaiting exit to prevent pipe buffer deadlock
|
||||
const [stdout] = await Promise.all([
|
||||
new Response(proc.stdout).text(),
|
||||
new Response(proc.stderr).text(),
|
||||
]);
|
||||
const exitCode = await proc.exited;
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(`run_server_capture failed (exit ${exitCode})`);
|
||||
}
|
||||
return stdout.trim();
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
|
||||
export async function uploadFile(localPath: string, remotePath: string): Promise<void> {
|
||||
if (
|
||||
!/^[a-zA-Z0-9/_.~-]+$/.test(remotePath) ||
|
||||
|
|
|
|||
|
|
@ -1136,46 +1136,6 @@ export async function runServer(cmd: string, timeoutSecs?: number, ip?: string):
|
|||
}
|
||||
}
|
||||
|
||||
export async function runServerCapture(cmd: string, timeoutSecs?: number, ip?: string): Promise<string> {
|
||||
const serverIp = ip || _state.serverIp;
|
||||
const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
|
||||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
|
||||
const proc = Bun.spawn(
|
||||
[
|
||||
"ssh",
|
||||
...SSH_BASE_OPTS,
|
||||
...keyOpts,
|
||||
`root@${serverIp}`,
|
||||
fullCmd,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"pipe",
|
||||
"pipe",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
||||
const timeout = (timeoutSecs || 300) * 1000;
|
||||
const timer = setTimeout(() => killWithTimeout(proc), timeout);
|
||||
try {
|
||||
// Drain both pipes before awaiting exit to prevent pipe buffer deadlock
|
||||
const [stdout] = await Promise.all([
|
||||
new Response(proc.stdout).text(),
|
||||
new Response(proc.stderr).text(),
|
||||
]);
|
||||
const exitCode = await proc.exited;
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(`run_server_capture failed (exit ${exitCode})`);
|
||||
}
|
||||
return stdout.trim();
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
|
||||
export async function uploadFile(localPath: string, remotePath: string, ip?: string): Promise<void> {
|
||||
const serverIp = ip || _state.serverIp;
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -944,46 +944,6 @@ export async function runServer(cmd: string, timeoutSecs?: number): Promise<void
|
|||
}
|
||||
}
|
||||
|
||||
export async function runServerCapture(cmd: string, timeoutSecs?: number): Promise<string> {
|
||||
const username = resolveUsername();
|
||||
const fullCmd = `export PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
|
||||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
|
||||
const proc = Bun.spawn(
|
||||
[
|
||||
"ssh",
|
||||
...SSH_BASE_OPTS,
|
||||
...keyOpts,
|
||||
`${username}@${_state.serverIp}`,
|
||||
`bash -c ${shellQuote(fullCmd)}`,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"pipe",
|
||||
"pipe",
|
||||
],
|
||||
env: process.env,
|
||||
},
|
||||
);
|
||||
const timeout = (timeoutSecs || 300) * 1000;
|
||||
const timer = setTimeout(() => killWithTimeout(proc), timeout);
|
||||
try {
|
||||
// Drain both pipes before awaiting exit to prevent pipe buffer deadlock
|
||||
const [stdout] = await Promise.all([
|
||||
new Response(proc.stdout).text(),
|
||||
new Response(proc.stderr).text(),
|
||||
]);
|
||||
const exitCode = await proc.exited;
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(`run_server_capture failed (exit ${exitCode})`);
|
||||
}
|
||||
return stdout.trim();
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
|
||||
export async function uploadFile(localPath: string, remotePath: string): Promise<void> {
|
||||
if (
|
||||
!/^[a-zA-Z0-9/_.~$-]+$/.test(remotePath) ||
|
||||
|
|
|
|||
|
|
@ -574,46 +574,6 @@ export async function runServer(cmd: string, timeoutSecs?: number, ip?: string):
|
|||
}
|
||||
}
|
||||
|
||||
export async function runServerCapture(cmd: string, timeoutSecs?: number, ip?: string): Promise<string> {
|
||||
const serverIp = ip || _state.serverIp;
|
||||
const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
|
||||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
|
||||
const proc = Bun.spawn(
|
||||
[
|
||||
"ssh",
|
||||
...SSH_BASE_OPTS,
|
||||
...keyOpts,
|
||||
`root@${serverIp}`,
|
||||
fullCmd,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"pipe",
|
||||
"pipe",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
||||
const timeout = (timeoutSecs || 300) * 1000;
|
||||
const timer = setTimeout(() => killWithTimeout(proc), timeout);
|
||||
try {
|
||||
// Drain both pipes before awaiting exit to prevent pipe buffer deadlock
|
||||
const [stdout] = await Promise.all([
|
||||
new Response(proc.stdout).text(),
|
||||
new Response(proc.stderr).text(),
|
||||
]);
|
||||
const exitCode = await proc.exited;
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(`run_server_capture failed (exit ${exitCode})`);
|
||||
}
|
||||
return stdout.trim();
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
|
||||
export async function uploadFile(localPath: string, remotePath: string, ip?: string): Promise<void> {
|
||||
const serverIp = ip || _state.serverIp;
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue