diff --git a/npm/dist/getBinary.js b/npm/dist/getBinary.js index f9c926e..a52827b 100644 --- a/npm/dist/getBinary.js +++ b/npm/dist/getBinary.js @@ -7,7 +7,8 @@ const os = require("os"); function getPlatform() { const type = os.type(); const arch = os.arch(); - if ((type === "Linux" || type === "Darwin") && arch === "x64") { + // Darwind x86_64 is not supported for quite some time :( + if (type === "Linux" && arch === "x64") { return [type, "x86_64"]; } else if (type === "Darwin" && arch === "arm64") { @@ -17,7 +18,7 @@ function getPlatform() { } function AWSUrl() { const [platform, arch] = getPlatform(); - return `https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${platform}-${arch}/1.40.0/7dd0b5993577f592be15eb102e5a3da37be66271/near-sandbox.tar.gz`; + return `https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${platform}-${arch}/2.1.1/near-sandbox.tar.gz`; } exports.AWSUrl = AWSUrl; function getBinary(name = "near-sandbox") { diff --git a/npm/dist/index.js b/npm/dist/index.js index 2ac735e..898165d 100644 --- a/npm/dist/index.js +++ b/npm/dist/index.js @@ -74,7 +74,11 @@ class Binary { get binPath() { return (0, path_1.join)(this.installDir, this.name); } - download(url) { + async download(url) { + // Ensure the install directory exists + if (!await (0, utils_1.fileExists)(this.installDir)) { + await fs.mkdir(this.installDir, { recursive: true }); + } return pipeline(got_1.default.stream(url), new stream.PassThrough(), tar.x({ strip: 1, C: this.installDir })); } async install() {