| author | |
| committer | |
| log | 584af5af4526fea4ad623c7bad931ef97d2fdb17 |
| tree | 2408b894023a069d278aeae0b41a7fe57306cf88 |
| parent | 758d54a9bb713bbb881c9218ff74c53877b4a6c4 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 8 insertions(+), 1 deletions(-)
packages/ssh/src/tunnel.test.ts+6| ... | ... | @@ -232,6 +232,12 @@ describe("ssh tunnel scripts", () => { |
| 232 | 232 | assert.notInclude(script, "npx"); |
| 233 | 233 | }); |
| 234 | 234 | |
| 235 | it("embeds the runner in the launch script byte for byte", () => { | |
| 236 | const runner = buildRemoteT3RunnerScript(ARCHIVE); | |
| 237 | assert.include(runner, 'printf \'%s\\n\' "$$" > "$T3_LOCK/pid.tmp"'); | |
| 238 | assert.include(buildRemoteLaunchScript(ARCHIVE), runner); | |
| 239 | }); | |
| 240 | ||
| 235 | 241 | it("uses the remote t3 runner for launch and pairing scripts", () => { |
| 236 | 242 | const stateKey = "711bc738002d72fd"; |
| 237 | 243 | const launch = SshTunnel.buildRemoteLaunchScript(ARCHIVE); |
packages/ssh/src/tunnel.ts+2-1| ... | ... | @@ -240,7 +240,8 @@ function applyScriptPlaceholders( |
| 240 | 240 | ): string { |
| 241 | 241 | let result = template; |
| 242 | 242 | for (const [token, value] of Object.entries(replacements)) { |
| 243 | result = result.replaceAll(`@@${token}@@`, value); | |
| 243 | // A replacer function keeps `$$` and other `$` patterns in the value literal. | |
| 244 | result = result.replaceAll(`@@${token}@@`, () => value); | |
| 244 | 245 | } |
| 245 | 246 | return result; |
| 246 | 247 | } |