Skip to content

Commit

Permalink
fix binary-install (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxck authored Mar 3, 2021
1 parent a46cfd7 commit 91c2624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"private": false,
"dependencies": {
"binary-install": "^0.1.1",
"@cloudflare/binary-install": "0.2.0",
"actions-toolkit": "^2.2.0",
"yargs": "^15.3.1"
},
Expand Down
5 changes: 3 additions & 2 deletions tools/npm/utils/binary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Binary } = require("binary-install");
const { Binary } = require("@cloudflare/binary-install");
const os = require("os");

function getPlatform() {
Expand All @@ -15,7 +15,8 @@ function getPlatform() {
function getBinary() {
const platform_arch = getPlatform();
const version = require("../package.json").version;
const url = `https://github.com/zeropsio/zcli/releases/download/v${version}/zcli-${platform_arch}-npm.tar.gz`;
const compatibleVersion = version.startsWith('v') ? version : `v${version}`;
const url = `https://github.com/zeropsio/zcli/releases/download/${compatibleVersion}/zcli-${platform_arch}-npm.tar.gz`;
const name = `zcli-${platform_arch}`;
return new Binary(url, { name });
}
Expand Down

0 comments on commit 91c2624

Please sign in to comment.