GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(ssh): 更新远程启动测试夹具 · pingdotgg/t3code@3187731

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/ssh/src
    • tunnel.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: packages/ssh/src/tunnel.test.ts
+11-14Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ switch (args[1]) {
448448
// earlier launch writes through the log descriptor it still holds (fd 3).
449449
yield* fs.writeFileString(
450450
NodePath.join(bin, "node"),
451-
'#!/bin/sh\n[ "$1" = - ] || exit 0\ncat >/dev/null\ncase "$2" in\n */port) echo 37731 ;;\n 37731) { printf "EARLIER_PROCESS\\n" >&3; } 2>/dev/null; exit 1 ;;\n *) exit 1 ;;\nesac\n',
451+
'#!/bin/sh\ncase "$2" in __ssh-helper) [ "$3" = home-dir ] && printf "%s" "$HOME/.t3"; exit ;; esac\n[ "$1" = - ] || exit 0\ncat >/dev/null\ncase "$2" in\n */port) echo 37731 ;;\n 37731) { printf "EARLIER_PROCESS\\n" >&3; } 2>/dev/null; exit 1 ;;\n *) exit 1 ;;\nesac\n',
452452
{ mode: 0o755 },
453453
);
454454
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
@@ -575,25 +575,20 @@ switch (args[1]) {
575575
NodeChildProcess.execFileSync("sh", ["-c", `sha256sum ${archive} > SHA256SUMS`], {
576576
cwd: release,
577577
});
578-
for (const tool of [
579-
"sh",
580-
"mkdir",
581-
"mktemp",
582-
"cat",
583-
"rm",
584-
"grep",
585-
"cut",
586-
checksum,
587-
"tar",
588-
"mv",
589-
]) {
578+
for (const tool of ["sh", "mkdir", "mktemp", "cat", "rm", "grep", "cut", checksum, "mv"]) {
590579
NodeFS.symlinkSync(
591580
NodeChildProcess.execFileSync("sh", ["-c", `command -v ${tool}`], {
592581
encoding: "utf8",
593582
}).trim(),
594583
NodePath.join(bin, tool),
595584
);
596585
}
586+
// Some tar builds decompress gzip internally, even when PATH has no gzip binary.
587+
NodeFS.writeFileSync(
588+
NodePath.join(bin, "tar"),
589+
'#!/bin/sh\nprintf "Cannot exec gzip\\n" >&2\nexit 1\n',
590+
{ mode: 0o755 },
591+
);
597592
NodeFS.writeFileSync(
598593
NodePath.join(bin, "uname"),
599594
'#!/bin/sh\ncase "$1" in -s) echo Linux ;; -m) echo x86_64 ;; esac\n',
@@ -1677,7 +1672,9 @@ const canBind = (port) =>
16771672
return;
16781673
}
16791674
const [helper, a, b, c] = args.slice(1);
1680-
if (helper === "pick-port") {
1675+
if (helper === "home-dir") {
1676+
return process.stdout.write(path.join(process.env.HOME, ".t3"));
1677+
} else if (helper === "pick-port") {
16811678
const start = Number(fs.existsSync(a) ? fs.readFileSync(a, "utf8") : b);
16821679
for (let port = start; port < start + Number(c); port += 1) {
16831680
if (await canBind(port)) return process.stdout.write(String(port));

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.