typeslayer 0.1.2 → 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/README.md +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +8 -4
package/README.md
CHANGED
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -15,26 +15,30 @@ const getBinaryInfo = () => {
|
|
|
15
15
|
const plat = platform();
|
|
16
16
|
const architecture = arch();
|
|
17
17
|
|
|
18
|
-
let platformDir, binaryName;
|
|
18
|
+
let platformDir, binaryName, releaseAssetName;
|
|
19
19
|
|
|
20
20
|
if (plat === "linux" && architecture === "x64") {
|
|
21
21
|
platformDir = "linux-x64";
|
|
22
22
|
binaryName = "typeslayer";
|
|
23
|
+
releaseAssetName = "typeslayer-linux-x64";
|
|
23
24
|
} else if (plat === "darwin" && architecture === "x64") {
|
|
24
25
|
platformDir = "darwin-x64";
|
|
25
26
|
binaryName = "typeslayer";
|
|
27
|
+
releaseAssetName = "typeslayer-darwin-x64";
|
|
26
28
|
} else if (plat === "darwin" && architecture === "arm64") {
|
|
27
29
|
platformDir = "darwin-arm64";
|
|
28
30
|
binaryName = "typeslayer";
|
|
31
|
+
releaseAssetName = "typeslayer-darwin-arm64";
|
|
29
32
|
} else if (plat === "win32" && architecture === "x64") {
|
|
30
33
|
platformDir = "win32-x64";
|
|
31
34
|
binaryName = "typeslayer.exe";
|
|
35
|
+
releaseAssetName = "typeslayer-win32-x64.exe";
|
|
32
36
|
} else {
|
|
33
37
|
console.warn(`⚠️ Platform ${plat}-${architecture} is not supported`);
|
|
34
38
|
process.exit(0); // Don't fail the install, just skip
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
return { platformDir, binaryName };
|
|
41
|
+
return { platformDir, binaryName, releaseAssetName };
|
|
38
42
|
};
|
|
39
43
|
|
|
40
44
|
const downloadBinary = (url, destPath) => {
|
|
@@ -83,7 +87,7 @@ const downloadBinary = (url, destPath) => {
|
|
|
83
87
|
|
|
84
88
|
(async () => {
|
|
85
89
|
try {
|
|
86
|
-
const { platformDir, binaryName } = getBinaryInfo();
|
|
90
|
+
const { platformDir, binaryName, releaseAssetName } = getBinaryInfo();
|
|
87
91
|
const binariesDir = join(__dirname, "..", "binaries", platformDir);
|
|
88
92
|
const binaryPath = join(binariesDir, binaryName);
|
|
89
93
|
|
|
@@ -97,7 +101,7 @@ const downloadBinary = (url, destPath) => {
|
|
|
97
101
|
mkdirSync(binariesDir, { recursive: true });
|
|
98
102
|
|
|
99
103
|
// Download from GitHub release
|
|
100
|
-
const releaseUrl = `https://github.com/dimitropoulos/typeslayer/releases/download/typeslayer-v${PACKAGE_VERSION}/${
|
|
104
|
+
const releaseUrl = `https://github.com/dimitropoulos/typeslayer/releases/download/typeslayer-v${PACKAGE_VERSION}/${releaseAssetName}`;
|
|
101
105
|
|
|
102
106
|
await downloadBinary(releaseUrl, binaryPath);
|
|
103
107
|
} catch (error) {
|