@justestif/go-jobs 0.0.0 → 0.1.3
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/install.js +8 -6
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -10,11 +10,11 @@ const REPO = "justEstif/go-jobs";
|
|
|
10
10
|
const VERSION = require("./package.json").version;
|
|
11
11
|
|
|
12
12
|
const PLATFORM_MAP = {
|
|
13
|
-
"linux-x64": { os: "linux", arch: "amd64", ext: ".tar.gz" },
|
|
14
|
-
"linux-arm64": { os: "linux", arch: "arm64", ext: ".tar.gz" },
|
|
15
|
-
"darwin-x64": { os: "darwin", arch: "amd64", ext: ".tar.gz" },
|
|
16
|
-
"darwin-arm64": { os: "darwin", arch: "arm64", ext: ".tar.gz" },
|
|
17
|
-
"win32-x64": { os: "windows", arch: "amd64", ext: ".zip" },
|
|
13
|
+
"linux-x64": { os: "linux", arch: "amd64", ext: ".tar.gz", files: ["jobs", "jobs-server"] },
|
|
14
|
+
"linux-arm64": { os: "linux", arch: "arm64", ext: ".tar.gz", files: ["jobs", "jobs-server"] },
|
|
15
|
+
"darwin-x64": { os: "darwin", arch: "amd64", ext: ".tar.gz", files: ["jobs", "jobs-server"] },
|
|
16
|
+
"darwin-arm64": { os: "darwin", arch: "arm64", ext: ".tar.gz", files: ["jobs", "jobs-server"] },
|
|
17
|
+
"win32-x64": { os: "windows", arch: "amd64", ext: ".zip", files: ["jobs.exe"] },
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const key = `${process.platform}-${process.arch}`;
|
|
@@ -73,9 +73,11 @@ download(url, tmpFile, (err) => {
|
|
|
73
73
|
|
|
74
74
|
try {
|
|
75
75
|
if (plat.ext === ".zip") {
|
|
76
|
+
// Windows: extract only jobs.exe
|
|
76
77
|
execFileSync("unzip", ["-j", tmpFile, exe, "-d", binDir]);
|
|
77
78
|
} else {
|
|
78
|
-
|
|
79
|
+
// Unix: extract only jobs (ignore jobs-server)
|
|
80
|
+
execFileSync("tar", ["-xzf", tmpFile, "-C", binDir, exe]);
|
|
79
81
|
}
|
|
80
82
|
fs.chmodSync(outPath, 0o755);
|
|
81
83
|
fs.unlinkSync(tmpFile);
|