Skip to content

Commit 39bae68

Browse files
committed
🤖 Fix SSHRuntime.resolvePath() to work with BusyBox
Use simple bash echo to expand tildes instead of readlink -m, which is not available in BusyBox (used in SSH Docker test container). The command `bash -c 'p=$path; echo $p'` lets bash expand ~ naturally without requiring GNU coreutils or python3. This fixes runtimeFileEditing integration tests that were failing with: readlink: unrecognized option: m All tests now pass (8/8 in runtimeFileEditing). Generated with `cmux`
1 parent 8aa211e commit 39bae68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/SSHRuntime.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ export class SSHRuntime implements Runtime {
322322
};
323323
}
324324
async resolvePath(filePath: string): Promise<string> {
325-
// Use shell to expand tildes and normalize path on remote system
326-
// Uses bash to expand ~ and readlink -m to normalize without checking existence
327-
// readlink -m canonicalizes the path (handles .., ., //) without requiring it to exist
328-
const command = `bash -c 'readlink -m ${shescape.quote(filePath)}'`;
325+
// Use shell to expand tildes on remote system
326+
// Bash will expand ~ automatically when we echo the unquoted variable
327+
// This works with BusyBox (doesn't require GNU coreutils)
328+
const command = `bash -c 'p=${shescape.quote(filePath)}; echo $p'`;
329329
// Use 5 second timeout for path resolution (should be near-instant)
330330
return this.execSSHCommand(command, 5000);
331331
}

0 commit comments

Comments
 (0)