warpo 2.1.0-beta-2 → 2.1.0-beta-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/warpo.js +5 -6
- package/package.json +1 -1
package/dist/warpo.js
CHANGED
|
@@ -4,8 +4,10 @@ import { execSync, spawn } from "node:child_process";
|
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
var dirname = import.meta.dirname;
|
|
7
|
-
function download_url(version
|
|
8
|
-
|
|
7
|
+
function download_url(version) {
|
|
8
|
+
var arch = os.arch();
|
|
9
|
+
var platform = os.platform();
|
|
10
|
+
if ((platform === "linux" && arch === "x86_64") || (platform === "darwin" && arch === "arm64")) {
|
|
9
11
|
return "https://github.com/wasm-ecosystem/warpo/releases/download/".concat(version, "/warpo-").concat(version, "-").concat(platform, "-").concat(arch, ".tar.gz");
|
|
10
12
|
}
|
|
11
13
|
console.log("there is no precompiled binary for ".concat(version, " + ").concat(platform, " + ").concat(arch, ", please compile from source."));
|
|
@@ -20,10 +22,7 @@ function get_binary() {
|
|
|
20
22
|
}
|
|
21
23
|
var version = process.env["WARPO_DOWNLOAD_VERSION"] ||
|
|
22
24
|
JSON.parse(readFileSync(join(dirname, "..", "package.json"), "utf8")).version;
|
|
23
|
-
var
|
|
24
|
-
if (platform === "darwin")
|
|
25
|
-
platform = "macos";
|
|
26
|
-
var url = download_url(version, os.arch(), platform);
|
|
25
|
+
var url = download_url(version);
|
|
27
26
|
console.log("downloading warpo from ".concat(url));
|
|
28
27
|
execSync("curl -L ".concat(url, " | tar xz -C ").concat(dirname), { stdio: "inherit" });
|
|
29
28
|
return join(dirname, "warpo", "warpo_asc");
|