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
7 changes: 6 additions & 1 deletion bin/railway.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ try {
stdio: "inherit",
});
} catch (e) {
exit(1);
if (e.signal) {
console.error(
`The railway binary crashed with ${e.signal}. Please report this at https://github.com/railwayapp/cli/issues`,
);
}
exit(typeof e.status === "number" ? e.status : 1);
}
17 changes: 14 additions & 3 deletions npm-install/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ async function install() {

// Fetch Static Config
let { name: binName, path: binPath, url } = CONFIG;
let triple = triples.platformArchTriples[process.platform][process.arch][0];

url = url.replace(/{{triple}}/g, triple.raw);
// Linux: statically linked musl builds, same policy as install.sh (the gnu
// build crashes on some hosts, see #998; arm/arm64 only publish musl).
const linuxTargets = {
x64: "x86_64-unknown-linux-musl",
arm64: "aarch64-unknown-linux-musl",
ia32: "i686-unknown-linux-musl",
arm: "arm-unknown-linux-musleabihf",
};
const triple =
process.platform === "linux"
? linuxTargets[process.arch]
: triples.platformArchTriples[process.platform][process.arch][0].raw;

url = url.replace(/{{triple}}/g, triple);
url = url.replace(/{{version}}/g, version);
url = url.replace(/{{bin_name}}/g, binName);
console.log(url);
Expand Down