Skip to content

Commit 669e161

Browse files
committed
test(ssh): teach main's launch fixtures the home-dir and version calls
1 parent 984c585 commit 669e161

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/ssh/src/tunnel.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ const fakeT3Serve = (publishDelayMs: number | null) => `const fs = require("node
104104
const http = require("node:http");
105105
const path = require("node:path");
106106
const args = process.argv.slice(2);
107+
if (args.join(" ") === "__ssh-helper home-dir") {
108+
process.stdout.write(path.join(process.env.HOME, ".t3"));
109+
process.exit(0);
110+
}
107111
const port = Number(args[args.indexOf("--port") + 1]);
108112
const userdata = path.join(args[args.indexOf("--base-dir") + 1], "userdata");
109113
const servers = path.join(process.env.HOME, "servers");
@@ -255,7 +259,7 @@ process.stdout.write(args[0] === "__ssh-helper"
255259
`#!${process.execPath}
256260
const fs = require("node:fs");
257261
const args = process.argv.slice(2);
258-
if (args[0] === "serve") process.exit(0);
262+
if (args[0] === "serve" || args[0] === "--version") process.exit(0);
259263
if (args[0] !== "__ssh-helper") process.exit(21);
260264
switch (args[1]) {
261265
case "home-dir": process.stdout.write(process.env.T3CODE_HOME); break;

0 commit comments

Comments
 (0)