@shenvy/cli 0.1.0 → 0.1.1
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/Formula/shenvy.rb +8 -8
- package/bin/install.js +23 -8
- package/package.json +1 -1
- package/scoop/shenvy.json +4 -4
package/Formula/shenvy.rb
CHANGED
|
@@ -9,16 +9,16 @@ class Shenvy < Formula
|
|
|
9
9
|
|
|
10
10
|
on_macos do
|
|
11
11
|
if Hardware::CPU.intel?
|
|
12
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/
|
|
13
|
-
sha256 "
|
|
12
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy_darwin_amd64.tar.gz"
|
|
13
|
+
sha256 "bf74583e91bdd8fd53d943931cbf8aa6e5b643b7f4bcfec5025a830b07648e76"
|
|
14
14
|
|
|
15
15
|
define_method(:install) do
|
|
16
16
|
bin.install "shenvy"
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
if Hardware::CPU.arm?
|
|
20
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/
|
|
21
|
-
sha256 "
|
|
20
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy_darwin_arm64.tar.gz"
|
|
21
|
+
sha256 "924c4bb5a674b6b3f60735145a0c639649ae1ff82f435a3204e06a7ae8ade24e"
|
|
22
22
|
|
|
23
23
|
define_method(:install) do
|
|
24
24
|
bin.install "shenvy"
|
|
@@ -28,15 +28,15 @@ class Shenvy < Formula
|
|
|
28
28
|
|
|
29
29
|
on_linux do
|
|
30
30
|
if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
|
|
31
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/
|
|
32
|
-
sha256 "
|
|
31
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy_linux_amd64.tar.gz"
|
|
32
|
+
sha256 "53412ca19a768daddb73adcd33b40d633bcde3bb471acee087ce2e7b379216a0"
|
|
33
33
|
define_method(:install) do
|
|
34
34
|
bin.install "shenvy"
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
|
38
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/
|
|
39
|
-
sha256 "
|
|
38
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy_linux_arm64.tar.gz"
|
|
39
|
+
sha256 "9639b4b572f9cea8c3d4fa27ac97c52407ea6bb4a8108fb3e4eb2c445bd641f8"
|
|
40
40
|
define_method(:install) do
|
|
41
41
|
bin.install "shenvy"
|
|
42
42
|
end
|
package/bin/install.js
CHANGED
|
@@ -4,10 +4,13 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const https = require('https');
|
|
6
6
|
const os = require('os');
|
|
7
|
+
const { execSync } = require('child_process');
|
|
7
8
|
|
|
8
9
|
const PROJECT_NAME = 'shenvy';
|
|
9
10
|
const REPO = 'Shenvy/shenvy-cli-dist';
|
|
10
|
-
|
|
11
|
+
// For the binary download, we still point to v0.1.0 since that's the latest CLI release
|
|
12
|
+
// even if the NPM wrapper version bumps to 0.1.1
|
|
13
|
+
const BINARY_VERSION = '0.1.0';
|
|
11
14
|
|
|
12
15
|
const platform = os.platform();
|
|
13
16
|
const arch = os.arch();
|
|
@@ -28,9 +31,11 @@ if (!archiveName) {
|
|
|
28
31
|
process.exit(1);
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
const url = `https://github.com/${REPO}/releases/download/v${
|
|
34
|
+
const url = `https://github.com/${REPO}/releases/download/v${BINARY_VERSION}/${PROJECT_NAME}_${archiveName}`;
|
|
32
35
|
const binDir = path.join(__dirname);
|
|
33
|
-
const
|
|
36
|
+
const tempArchive = path.join(binDir, archiveName);
|
|
37
|
+
const finalBinName = platform === 'win32' ? 'shenvy.exe' : 'shenvy';
|
|
38
|
+
const finalBinPath = path.join(binDir, platform === 'win32' ? 'shenvy.exe' : 'shenvy-bin');
|
|
34
39
|
|
|
35
40
|
console.log(`Downloading ${PROJECT_NAME} for ${target} from ${url}...`);
|
|
36
41
|
|
|
@@ -57,13 +62,23 @@ function download(url, dest) {
|
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
|
|
60
|
-
|
|
61
|
-
// but to keep dependencies zero, we would ideally bundle them or use child_process for unzip/tar.
|
|
62
|
-
// For this template, we assume the binary is directly downloadable or handled by a small helper.
|
|
63
|
-
download(url, binPath)
|
|
65
|
+
download(url, tempArchive)
|
|
64
66
|
.then(() => {
|
|
67
|
+
console.log('Extracting archive...');
|
|
68
|
+
// Use native tar (available in Win10+, macOS, Linux) to extract
|
|
69
|
+
execSync(`tar -xf "${tempArchive}" -C "${binDir}"`);
|
|
70
|
+
|
|
71
|
+
// Rename the extracted binary to the expected name if needed
|
|
72
|
+
const extractedBinPath = path.join(binDir, finalBinName);
|
|
73
|
+
if (extractedBinPath !== finalBinPath) {
|
|
74
|
+
fs.renameSync(extractedBinPath, finalBinPath);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Clean up the archive
|
|
78
|
+
fs.unlinkSync(tempArchive);
|
|
79
|
+
|
|
65
80
|
if (platform !== 'win32') {
|
|
66
|
-
fs.chmodSync(
|
|
81
|
+
fs.chmodSync(finalBinPath, 0o755);
|
|
67
82
|
}
|
|
68
83
|
console.log(`${PROJECT_NAME} installed successfully.`);
|
|
69
84
|
})
|
package/package.json
CHANGED
package/scoop/shenvy.json
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
"version": "0.1.0",
|
|
3
3
|
"architecture": {
|
|
4
4
|
"64bit": {
|
|
5
|
-
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/
|
|
5
|
+
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy_windows_amd64.zip",
|
|
6
6
|
"bin": [
|
|
7
7
|
"shenvy.exe"
|
|
8
8
|
],
|
|
9
|
-
"hash": "
|
|
9
|
+
"hash": "c643fca42505730c4e015d811e172bd9a6201316ebfbd513ae1608a8c97a3a77"
|
|
10
10
|
},
|
|
11
11
|
"arm64": {
|
|
12
|
-
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/
|
|
12
|
+
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy_windows_arm64.zip",
|
|
13
13
|
"bin": [
|
|
14
14
|
"shenvy.exe"
|
|
15
15
|
],
|
|
16
|
-
"hash": "
|
|
16
|
+
"hash": "641dff0ad0fe9d06f199b07ed1b7e46db8e4253ed60892b2b31c5960dd0ead55"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://shenvy.dev",
|