@dcdavidev/bastion-cli 0.1.9
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/bin/index.js +38 -0
- package/package.json +18 -0
package/bin/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
// Mapping OS and architecture to the folders created by GoReleaser
|
|
8
|
+
const platforms = {
|
|
9
|
+
'darwin': {
|
|
10
|
+
'x64': 'darwin_amd64/bastion-cli',
|
|
11
|
+
'arm64': 'darwin_arm64/bastion-cli'
|
|
12
|
+
},
|
|
13
|
+
'linux': {
|
|
14
|
+
'x64': 'linux_amd64/bastion-cli',
|
|
15
|
+
'arm64': 'linux_arm64/bastion-cli'
|
|
16
|
+
},
|
|
17
|
+
'win32': {
|
|
18
|
+
'x64': 'windows_amd64/bastion-cli.exe',
|
|
19
|
+
'arm64': 'windows_arm64/bastion-cli.exe'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const platform = os.platform();
|
|
24
|
+
const arch = os.arch();
|
|
25
|
+
|
|
26
|
+
if (!platforms[platform] || !platforms[platform][arch]) {
|
|
27
|
+
console.error(`Unsupported platform/architecture: ${platform}/${arch}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const binaryPath = path.join(__dirname, platforms[platform][arch]);
|
|
32
|
+
const args = process.argv.slice(2);
|
|
33
|
+
|
|
34
|
+
const child = spawn(binaryPath, args, { stdio: 'inherit' });
|
|
35
|
+
|
|
36
|
+
child.on('close', (code) => {
|
|
37
|
+
process.exit(code);
|
|
38
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dcdavidev/bastion-cli",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Bastion CLI - Secure secret management and execution",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/dcdavidev/bastion.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": "Davide Di Criscito",
|
|
11
|
+
"main": "index.js",
|
|
12
|
+
"bin": {
|
|
13
|
+
"bastion": "bin/index.js"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
}
|
|
18
|
+
}
|