diff options
Diffstat (limited to 'preinstall.js')
-rw-r--r-- | preinstall.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/preinstall.js b/preinstall.js index d53bca2..91c3a52 100644 --- a/preinstall.js +++ b/preinstall.js | |||
@@ -85,7 +85,13 @@ if (process.platform === "win32") { | |||
85 | res.pipe(unzipper.Extract({ path: bindir })) | 85 | res.pipe(unzipper.Extract({ path: bindir })) |
86 | ); | 86 | ); |
87 | } else { | 87 | } else { |
88 | get("x86_64-linux.tar.bz2", res => | 88 | const isDarwin = process.platform === 'darwin'; |
89 | |||
90 | if (isDarwin && isLowerThan(dhallJsonVersion, "1.4.0")) { | ||
91 | throw new Error(`Static macOS binaries aren’t provided by \`dhall-json@<1.4.0\`.`); | ||
92 | } | ||
93 | |||
94 | get(`x86_64-${isDarwin ? 'macos' : 'linux'}.tar.bz2`, res => | ||
89 | res.pipe(unbz2()).pipe(tar.x({ C: __dirname }).on("finish", () => { | 95 | res.pipe(unbz2()).pipe(tar.x({ C: __dirname }).on("finish", () => { |
90 | fs.readdir(bindir, (err, names) => { | 96 | fs.readdir(bindir, (err, names) => { |
91 | if (err) throw err; | 97 | if (err) throw err; |