@shenvy/cli 0.1.0

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.
@@ -0,0 +1,49 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ # This file was generated by GoReleaser. DO NOT EDIT.
5
+ class Shenvy < Formula
6
+ desc "Securely manage environment variables with E2EE."
7
+ homepage "https://shenvy.dev"
8
+ version "0.1.0"
9
+
10
+ on_macos do
11
+ if Hardware::CPU.intel?
12
+ url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy-cli-dist_darwin_amd64.tar.gz"
13
+ sha256 "3f486c04513381da912c86c47f1be452467503d9cf01388b6a2649f6d3481776"
14
+
15
+ define_method(:install) do
16
+ bin.install "shenvy"
17
+ end
18
+ end
19
+ if Hardware::CPU.arm?
20
+ url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy-cli-dist_darwin_arm64.tar.gz"
21
+ sha256 "27a98935ba995bc06ae2e79511c1f9d84651b5b747affbbbfa83a8df27644f88"
22
+
23
+ define_method(:install) do
24
+ bin.install "shenvy"
25
+ end
26
+ end
27
+ end
28
+
29
+ on_linux do
30
+ if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
31
+ url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy-cli-dist_linux_amd64.tar.gz"
32
+ sha256 "fbe4afa3d3c854a8d3c5b8a6cda9c5111640be8363aa8f1980e97d40d1a5e8c7"
33
+ define_method(:install) do
34
+ bin.install "shenvy"
35
+ end
36
+ end
37
+ if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
38
+ url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy-cli-dist_linux_arm64.tar.gz"
39
+ sha256 "59161ee5b83b34f2f2dc843e5bb5a33484043fed293e8590756243c8b0c35fdc"
40
+ define_method(:install) do
41
+ bin.install "shenvy"
42
+ end
43
+ end
44
+ end
45
+
46
+ test do
47
+ system "#{bin}/shenvy version"
48
+ end
49
+ end
package/bin/install.js ADDED
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const https = require('https');
6
+ const os = require('os');
7
+
8
+ const PROJECT_NAME = 'shenvy';
9
+ const REPO = 'Shenvy/shenvy-cli-dist';
10
+ const VERSION = require('../package.json').version;
11
+
12
+ const platform = os.platform();
13
+ const arch = os.arch();
14
+
15
+ const platformMap = {
16
+ 'win32-x64': 'windows_amd64.zip',
17
+ 'darwin-x64': 'darwin_amd64.tar.gz',
18
+ 'darwin-arm64': 'darwin_arm64.tar.gz',
19
+ 'linux-x64': 'linux_amd64.tar.gz',
20
+ 'linux-arm64': 'linux_arm64.tar.gz'
21
+ };
22
+
23
+ const target = `${platform}-${arch}`;
24
+ const archiveName = platformMap[target];
25
+
26
+ if (!archiveName) {
27
+ console.error(`Error: Unsupported platform/architecture: ${target}`);
28
+ process.exit(1);
29
+ }
30
+
31
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${PROJECT_NAME}_${archiveName}`;
32
+ const binDir = path.join(__dirname);
33
+ const binPath = path.join(binDir, platform === 'win32' ? 'shenvy.exe' : 'shenvy-bin');
34
+
35
+ console.log(`Downloading ${PROJECT_NAME} for ${target} from ${url}...`);
36
+
37
+ function download(url, dest) {
38
+ return new Promise((resolve, reject) => {
39
+ const file = fs.createWriteStream(dest);
40
+ https.get(url, (response) => {
41
+ if (response.statusCode === 302 || response.statusCode === 301) {
42
+ return download(response.headers.location, dest).then(resolve).catch(reject);
43
+ }
44
+ if (response.statusCode !== 200) {
45
+ reject(new Error(`Failed to download: ${response.statusCode}`));
46
+ return;
47
+ }
48
+ response.pipe(file);
49
+ file.on('finish', () => {
50
+ file.close();
51
+ resolve();
52
+ });
53
+ }).on('error', (err) => {
54
+ fs.unlink(dest, () => {});
55
+ reject(err);
56
+ });
57
+ });
58
+ }
59
+
60
+ // Note: In a real production environment, we would use a library like 'tar' or 'adm-zip'
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)
64
+ .then(() => {
65
+ if (platform !== 'win32') {
66
+ fs.chmodSync(binPath, 0o755);
67
+ }
68
+ console.log(`${PROJECT_NAME} installed successfully.`);
69
+ })
70
+ .catch((err) => {
71
+ console.error(`Error installing ${PROJECT_NAME}:`, err.message);
72
+ process.exit(1);
73
+ });
package/bin/shenvy ADDED
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*) exe_ext=.exe ;;
6
+ *) exe_ext= ;;
7
+ esac
8
+
9
+ if [ -x "$basedir/shenvy-bin" ]; then
10
+ "$basedir/shenvy-bin" "$@"
11
+ else
12
+ # Fallback if binary is not yet downloaded
13
+ node "$basedir/install.js" && "$basedir/shenvy-bin" "$@"
14
+ fi
package/bin/shenvy.cmd ADDED
@@ -0,0 +1,9 @@
1
+ @echo off
2
+ setlocal
3
+ set "basedir=%~dp0"
4
+
5
+ if exist "%basedir%\shenvy.exe" (
6
+ "%basedir%\shenvy.exe" %*
7
+ ) else (
8
+ node "%basedir%\install.js" && "%basedir%\shenvy.exe" %*
9
+ )
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@shenvy/cli",
3
+ "version": "0.1.0",
4
+ "description": "Securely manage environment variables with E2EE (Go implementation wrapper)",
5
+ "main": "bin/install.js",
6
+ "bin": {
7
+ "shenvy": "bin/shenvy",
8
+ "shenvy-win": "bin/shenvy.cmd"
9
+ },
10
+ "scripts": {
11
+ "postinstall": "node bin/install.js"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/Shenvy/shenvy-cli-dist.git"
16
+ },
17
+ "keywords": [
18
+ "shenvy",
19
+ "cli",
20
+ "env",
21
+ "encryption",
22
+ "e2ee",
23
+ "environment",
24
+ "variables"
25
+ ],
26
+ "author": "Shenvy Team",
27
+ "license": "MIT",
28
+ "bugs": {
29
+ "url": "https://github.com/Shenvy/cli-dist/issues"
30
+ },
31
+ "homepage": "https://shenvy.dev",
32
+ "engines": {
33
+ "node": ">=14.0.0"
34
+ }
35
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "architecture": {
4
+ "64bit": {
5
+ "url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy-cli-dist_windows_amd64.zip",
6
+ "bin": [
7
+ "shenvy.exe"
8
+ ],
9
+ "hash": "cf9db60fa159a42b60ad88db90f5f03863c910fbe6eaaab46216891986da384e"
10
+ },
11
+ "arm64": {
12
+ "url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.0/shenvy-cli-dist_windows_arm64.zip",
13
+ "bin": [
14
+ "shenvy.exe"
15
+ ],
16
+ "hash": "5fd64935a48227a2308a740f2a630682367bfa4eec0e83f5153668d4bca381fe"
17
+ }
18
+ },
19
+ "homepage": "https://shenvy.dev",
20
+ "license": "MIT",
21
+ "description": "Securely manage environment variables with E2EE."
22
+ }