@shenvy/cli 0.1.3 → 0.1.5
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 +24 -24
- 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.4"
|
|
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.4/shenvy_darwin_amd64.tar.gz"
|
|
13
|
+
sha256 "47b6028e15045aa86b88bd2c7748734d09c015680d1d70b84d8c7347e575abfc"
|
|
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.4/shenvy_darwin_arm64.tar.gz"
|
|
21
|
+
sha256 "d271c0378619d9d19c9eba1aea8dcf53f463d65df3df2c27fd3986c72c7e10ec"
|
|
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.4/shenvy_linux_amd64.tar.gz"
|
|
32
|
+
sha256 "521dda0c72f2e415f6fa98148779f66b8ccb7366942cb9ba940d2a9491a513b6"
|
|
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.4/shenvy_linux_arm64.tar.gz"
|
|
39
|
+
sha256 "c3f64fb621a79a1bbe7f41127863677187b268904931f4516247661cc278760e"
|
|
40
40
|
define_method(:install) do
|
|
41
41
|
bin.install "shenvy"
|
|
42
42
|
end
|
package/bin/install.js
CHANGED
|
@@ -8,7 +8,8 @@ const { execSync } = require('child_process');
|
|
|
8
8
|
|
|
9
9
|
const PROJECT_NAME = 'shenvy';
|
|
10
10
|
const REPO = 'Shenvy/shenvy-cli-dist';
|
|
11
|
-
|
|
11
|
+
// Dynamically use the version from package.json
|
|
12
|
+
const VERSION = require('../package.json').version;
|
|
12
13
|
|
|
13
14
|
const platform = os.platform();
|
|
14
15
|
const arch = os.arch();
|
|
@@ -29,13 +30,13 @@ if (!archiveName) {
|
|
|
29
30
|
process.exit(1);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const url = `https://github.com/${REPO}/releases/download/v${
|
|
33
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${PROJECT_NAME}_${archiveName}`;
|
|
33
34
|
const binDir = path.join(__dirname);
|
|
34
35
|
const tempArchive = path.join(binDir, archiveName);
|
|
35
36
|
const finalBinName = platform === 'win32' ? 'shenvy.exe' : 'shenvy';
|
|
36
37
|
const finalBinPath = path.join(binDir, platform === 'win32' ? 'shenvy.exe' : 'shenvy-bin');
|
|
37
38
|
|
|
38
|
-
console.log(`Downloading ${PROJECT_NAME} for ${target} from ${url}...`);
|
|
39
|
+
console.log(`Downloading ${PROJECT_NAME} v${VERSION} for ${target} from ${url}...`);
|
|
39
40
|
|
|
40
41
|
function download(url, dest) {
|
|
41
42
|
return new Promise((resolve, reject) => {
|
|
@@ -64,34 +65,33 @@ download(url, tempArchive)
|
|
|
64
65
|
.then(() => {
|
|
65
66
|
console.log('Extracting archive...');
|
|
66
67
|
|
|
67
|
-
// Fix for Windows tar: use forward slashes and --force-local to avoid "hostname" error
|
|
68
|
-
const tarArchive = tempArchive.replace(/\\/g, '/');
|
|
69
|
-
const tarDir = binDir.replace(/\\/g, '/');
|
|
70
|
-
const forceLocal = platform === 'win32' ? '--force-local ' : '';
|
|
71
|
-
|
|
72
68
|
try {
|
|
73
|
-
|
|
69
|
+
if (platform === 'win32') {
|
|
70
|
+
const psCommand = `powershell.exe -NoProfile -Command "Expand-Archive -Path '${tempArchive}' -DestinationPath '${binDir}' -Force"`;
|
|
71
|
+
execSync(psCommand);
|
|
72
|
+
} else {
|
|
73
|
+
execSync(`tar -xzf "${tempArchive}" -C "${binDir}"`);
|
|
74
|
+
}
|
|
74
75
|
} catch (e) {
|
|
75
|
-
console.error('
|
|
76
|
-
|
|
76
|
+
console.error('Extraction failed:', e.message);
|
|
77
|
+
process.exit(1);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
// Rename the extracted binary to the expected name if needed
|
|
80
80
|
const extractedBinPath = path.join(binDir, finalBinName);
|
|
81
|
-
if (fs.existsSync(extractedBinPath)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
if (fs.existsSync(extractedBinPath)) {
|
|
82
|
+
if (platform !== 'win32' && extractedBinPath !== finalBinPath) {
|
|
83
|
+
if (fs.existsSync(finalBinPath)) fs.unlinkSync(finalBinPath);
|
|
84
|
+
fs.renameSync(extractedBinPath, finalBinPath);
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
console.error(`Error: Extracted binary ${finalBinName} not found`);
|
|
88
|
+
process.exit(1);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
console.log(`${PROJECT_NAME} installed successfully.`);
|
|
91
|
+
if (fs.existsSync(tempArchive)) fs.unlinkSync(tempArchive);
|
|
92
|
+
if (platform !== 'win32' && fs.existsSync(finalBinPath)) fs.chmodSync(finalBinPath, 0o755);
|
|
93
|
+
|
|
94
|
+
console.log(`${PROJECT_NAME} v${VERSION} installed successfully.`);
|
|
95
95
|
})
|
|
96
96
|
.catch((err) => {
|
|
97
97
|
console.error(`Error installing ${PROJECT_NAME}:`, err.message);
|
package/package.json
CHANGED
package/scoop/shenvy.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.4",
|
|
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.4/shenvy_windows_amd64.zip",
|
|
6
6
|
"bin": [
|
|
7
7
|
"shenvy.exe"
|
|
8
8
|
],
|
|
9
|
-
"hash": "
|
|
9
|
+
"hash": "708f718abc4360f4b5bfd92b88baa88160d11b140674e1fc8877068492e6bdb7"
|
|
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.4/shenvy_windows_arm64.zip",
|
|
13
13
|
"bin": [
|
|
14
14
|
"shenvy.exe"
|
|
15
15
|
],
|
|
16
|
-
"hash": "
|
|
16
|
+
"hash": "4075103c40e7fc8876dcf579e71675b1cc2cca076b63dc0a29dd4ff40be6fd81"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://shenvy.dev",
|