@shenvy/cli 0.1.4 → 0.1.6
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 +9 -9
- package/bin/install.js +29 -37
- package/package.json +1 -1
- package/scoop/shenvy.json +5 -5
package/Formula/shenvy.rb
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
class Shenvy < Formula
|
|
6
6
|
desc "Securely manage environment variables with E2EE."
|
|
7
7
|
homepage "https://shenvy.dev"
|
|
8
|
-
version "0.1.
|
|
8
|
+
version "0.1.5"
|
|
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.
|
|
13
|
-
sha256 "
|
|
12
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.5/shenvy_darwin_amd64.tar.gz"
|
|
13
|
+
sha256 "973fe552f0882cced7344a9625d4bd6e512b6294c2d2f23836a060928f8d1a09"
|
|
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.
|
|
21
|
-
sha256 "
|
|
20
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.5/shenvy_darwin_arm64.tar.gz"
|
|
21
|
+
sha256 "de37d80eb886b419d34f9bd27d232483e2f321c300b5c0c8c18a8f6f29396a13"
|
|
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.
|
|
32
|
-
sha256 "
|
|
31
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.5/shenvy_linux_amd64.tar.gz"
|
|
32
|
+
sha256 "7a10a12bb695283835de2a3530a27e813d52855566d916464fe82ad247fa89e0"
|
|
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.
|
|
39
|
-
sha256 "
|
|
38
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.5/shenvy_linux_arm64.tar.gz"
|
|
39
|
+
sha256 "207acb57c7abef500095320c61848aa87985ebd3f972f08d3e493e0118b45979"
|
|
40
40
|
define_method(:install) do
|
|
41
41
|
bin.install "shenvy"
|
|
42
42
|
end
|
package/bin/install.js
CHANGED
|
@@ -8,7 +8,7 @@ const { execSync } = require('child_process');
|
|
|
8
8
|
|
|
9
9
|
const PROJECT_NAME = 'shenvy';
|
|
10
10
|
const REPO = 'Shenvy/shenvy-cli-dist';
|
|
11
|
-
const
|
|
11
|
+
const VERSION = require('../package.json').version;
|
|
12
12
|
|
|
13
13
|
const platform = os.platform();
|
|
14
14
|
const arch = os.arch();
|
|
@@ -29,13 +29,13 @@ if (!archiveName) {
|
|
|
29
29
|
process.exit(1);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const url = `https://github.com/${REPO}/releases/download/v${
|
|
32
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/shenvy_${archiveName}`;
|
|
33
33
|
const binDir = path.join(__dirname);
|
|
34
34
|
const tempArchive = path.join(binDir, archiveName);
|
|
35
35
|
const finalBinName = platform === 'win32' ? 'shenvy.exe' : 'shenvy';
|
|
36
36
|
const finalBinPath = path.join(binDir, platform === 'win32' ? 'shenvy.exe' : 'shenvy-bin');
|
|
37
37
|
|
|
38
|
-
console.log(`Downloading ${PROJECT_NAME} for ${target} from ${url}...`);
|
|
38
|
+
console.log(`Downloading ${PROJECT_NAME} v${VERSION} for ${target} from ${url}...`);
|
|
39
39
|
|
|
40
40
|
function download(url, dest) {
|
|
41
41
|
return new Promise((resolve, reject) => {
|
|
@@ -49,10 +49,8 @@ function download(url, dest) {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
response.pipe(file);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
resolve();
|
|
55
|
-
});
|
|
52
|
+
// Wait for 'close' instead of 'finish' to ensure OS handle is released
|
|
53
|
+
file.on('close', resolve);
|
|
56
54
|
}).on('error', (err) => {
|
|
57
55
|
fs.unlink(dest, () => {});
|
|
58
56
|
reject(err);
|
|
@@ -60,25 +58,23 @@ function download(url, dest) {
|
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
async function install() {
|
|
62
|
+
try {
|
|
63
|
+
if (fs.existsSync(tempArchive)) fs.unlinkSync(tempArchive);
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
process.exit(1);
|
|
65
|
+
await download(url, tempArchive);
|
|
66
|
+
|
|
67
|
+
// Small delay to let the OS settle
|
|
68
|
+
await new Promise(r => setTimeout(r, 500));
|
|
69
|
+
|
|
70
|
+
console.log('Extracting archive...');
|
|
71
|
+
if (platform === 'win32') {
|
|
72
|
+
const psCommand = `powershell.exe -NoProfile -Command "Expand-Archive -Path '${tempArchive.replace(/'/g, "''")}' -DestinationPath '${binDir.replace(/'/g, "''")}' -Force"`;
|
|
73
|
+
execSync(psCommand);
|
|
74
|
+
} else {
|
|
75
|
+
execSync(`tar -xzf "${tempArchive}" -C "${binDir}"`);
|
|
79
76
|
}
|
|
80
77
|
|
|
81
|
-
// Rename the extracted binary to the expected name if needed (e.g., shenvy -> shenvy-bin)
|
|
82
78
|
const extractedBinPath = path.join(binDir, finalBinName);
|
|
83
79
|
if (fs.existsSync(extractedBinPath)) {
|
|
84
80
|
if (platform !== 'win32' && extractedBinPath !== finalBinPath) {
|
|
@@ -86,21 +82,17 @@ download(url, tempArchive)
|
|
|
86
82
|
fs.renameSync(extractedBinPath, finalBinPath);
|
|
87
83
|
}
|
|
88
84
|
} else {
|
|
89
|
-
|
|
90
|
-
process.exit(1);
|
|
85
|
+
throw new Error(`Extracted binary ${finalBinName} not found`);
|
|
91
86
|
}
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
if (fs.existsSync(
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (platform !== 'win32' && fs.existsSync(finalBinPath)) {
|
|
99
|
-
fs.chmodSync(finalBinPath, 0o755);
|
|
100
|
-
}
|
|
101
|
-
console.log(`${PROJECT_NAME} installed successfully.`);
|
|
102
|
-
})
|
|
103
|
-
.catch((err) => {
|
|
88
|
+
if (fs.existsSync(tempArchive)) fs.unlinkSync(tempArchive);
|
|
89
|
+
if (platform !== 'win32' && fs.existsSync(finalBinPath)) fs.chmodSync(finalBinPath, 0o755);
|
|
90
|
+
|
|
91
|
+
console.log(`${PROJECT_NAME} v${VERSION} installed successfully.`);
|
|
92
|
+
} catch (err) {
|
|
104
93
|
console.error(`Error installing ${PROJECT_NAME}:`, err.message);
|
|
105
94
|
process.exit(1);
|
|
106
|
-
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
install();
|
package/package.json
CHANGED
package/scoop/shenvy.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.5",
|
|
3
3
|
"architecture": {
|
|
4
4
|
"64bit": {
|
|
5
|
-
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
5
|
+
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.5/shenvy_windows_amd64.zip",
|
|
6
6
|
"bin": [
|
|
7
7
|
"shenvy.exe"
|
|
8
8
|
],
|
|
9
|
-
"hash": "
|
|
9
|
+
"hash": "19376e027a5ac7ea67f7ebfbd77b6835c91d03586b39cf868dde1da8e6fd6683"
|
|
10
10
|
},
|
|
11
11
|
"arm64": {
|
|
12
|
-
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
12
|
+
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.5/shenvy_windows_arm64.zip",
|
|
13
13
|
"bin": [
|
|
14
14
|
"shenvy.exe"
|
|
15
15
|
],
|
|
16
|
-
"hash": "
|
|
16
|
+
"hash": "b9e78019c4fd541db1f13b41e30250d144ca82496295059324d2093d4a1a3215"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://shenvy.dev",
|