Skip to content

Commit

Permalink
fix download for windows (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
adikari committed Dec 7, 2023
1 parent 193705d commit 2f5304c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
36 changes: 18 additions & 18 deletions npm/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@ const os = require("os");
const { join } = require("path");
const cTable = require("console.table");

const error = msg => {
const error = (msg) => {
console.error(msg);
process.exit(1);
};

const { version, repository } = require("./package.json");

const name = 'safebox';
const name = "safebox";

const supportedPlatforms = [
{
TYPE: "Darwin",
ARCHITECTURE: "x64",
TARGET: "darwin_amd64",
NAME: name
NAME: name,
},
{
TYPE: "Darwin",
ARCHITECTURE: "arm64",
TARGET: "darwin_arm64",
NAME: name
NAME: name,
},
{
TYPE: "Windows_NT",
ARCHITECTURE: "x64",
TARGET: "windows_amd64.exe",
NAME: `${name}.exe`
TARGET: "windows_amd64",
NAME: `${name}.exe`,
},
{
TYPE: "Windows_NT",
ARCHITECTURE: "arm64",
TARGET: "windows_arm64.exe",
NAME: `${name}.exe`
TARGET: "windows_arm64",
NAME: `${name}.exe`,
},
{
TYPE: "Windows_NT",
ARCHITECTURE: "ia32",
TARGET: "windows_386.exe",
NAME: `${name}.exe`
TARGET: "windows_386",
NAME: `${name}.exe`,
},
{
TYPE: "Linux",
ARCHITECTURE: "ia32",
TARGET: "linux_386",
NAME: name
NAME: name,
},
{
TYPE: "Linux",
ARCHITECTURE: "x64",
TARGET: "linux_amd64",
NAME: name
NAME: name,
},
{
TYPE: "Linux",
ARCHITECTURE: "arm64",
TARGET: "linux_arm64",
NAME: name
NAME: name,
},
];

Expand All @@ -78,16 +78,16 @@ const getPlatform = () => {

error(
`Platform with type "${type}" and architecture "${architecture}" is not supported by ${name}.\nYour system must be one of the following:\n\n${cTable.getTable(
supportedPlatforms
)}`
supportedPlatforms,
)}`,
);
};

const getBinary = () => {
const platform = getPlatform();

const url = `${repository.url}/releases/download/v${version}/${name}_${version}_${platform.TARGET}.tar.gz`;

return new Binary(platform.NAME, url);
};

Expand All @@ -103,5 +103,5 @@ const install = (supressLogs = false) => {

module.exports = {
install,
run
run,
};
4 changes: 2 additions & 2 deletions npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adikari/safebox",
"version": "1.3.11",
"version": "1.3.12",
"description": "A Fast and Flexible secret manager built with love by adikari in Go",
"main": "index.js",
"bin": "./run.js",
Expand Down

0 comments on commit 2f5304c

Please sign in to comment.