Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bend2/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ function cli_guide(name: string): void {
// cli_update runs the installer again: the one way bend changes. The
// command prints first, so the user can run it alone.
function cli_update(): void {
const cmd = "curl -fsSL " + ORIGIN + "/install.sh | sh";
const cmd = "s=$(curl -fsSL " + ORIGIN
+ "/install.sh) && printf '%s\\n' \"$s\" | sh";
cli_say(2, cmd + "\n");
process.exitCode = child.spawnSync("sh", ["-c", cmd],
{ stdio: "inherit" }).status ?? 1;
Expand Down
6 changes: 5 additions & 1 deletion gates/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,13 @@ try {
check("a dead origin costs one run under four seconds", dead.code === 0
&& dead.out.includes("usage:") && Date.now() - t0 < 4000);
const was = fs.statSync(BIN).ino;
const no_upd = await bend(["update"], { BEND_ORIGIN: "http://127.0.0.1:1" });
check("bend update fails when the installer download fails", no_upd.code !== 0
&& fs.statSync(BIN).ino === was);
const upd = await bend(["update"]);
check("bend update runs the installer again: " + upd.err, upd.code === 0
&& upd.err.startsWith("curl -fsSL " + ORIGIN + "/install.sh | sh\n")
&& upd.err.startsWith("s=$(curl -fsSL " + ORIGIN
+ "/install.sh) && printf '%s\\n' \"$s\" | sh\n")
&& plain(upd.out).includes("Bend \u2588 " + ver) && fs.statSync(BIN).ino !== was);
const guide = await bend(["guide"]);
const base = await bend(["base", "Map"]);
Expand Down