@miniaxolotl/burrowctl 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.
- package/bin/burrowctl.js +36 -0
- package/package.json +21 -0
package/bin/burrowctl.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
const { join, dirname } = require("path");
|
|
6
|
+
|
|
7
|
+
const PLATFORMS = {
|
|
8
|
+
"linux-x64": "@miniaxolotl/burrowctl-linux-x64",
|
|
9
|
+
"linux-arm64": "@miniaxolotl/burrowctl-linux-arm64",
|
|
10
|
+
"darwin-x64": "@miniaxolotl/burrowctl-darwin-x64",
|
|
11
|
+
"darwin-arm64": "@miniaxolotl/burrowctl-darwin-arm64",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const key = `${process.platform}-${process.arch}`;
|
|
15
|
+
const pkgName = PLATFORMS[key];
|
|
16
|
+
|
|
17
|
+
if (!pkgName) {
|
|
18
|
+
process.stderr.write(`burrowctl: unsupported platform ${key}\n`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let binDir;
|
|
23
|
+
try {
|
|
24
|
+
binDir = dirname(require.resolve(`${pkgName}/package.json`));
|
|
25
|
+
} catch {
|
|
26
|
+
process.stderr.write(`burrowctl: platform package ${pkgName} is not installed\n`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const result = spawnSync(
|
|
31
|
+
join(binDir, "burrowctl"),
|
|
32
|
+
process.argv.slice(2),
|
|
33
|
+
{ stdio: "inherit" },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@miniaxolotl/burrowctl",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI client for the burrow tunnel server",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/miniaxolotl/burrow"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"burrowctl": "bin/burrowctl.js"
|
|
12
|
+
},
|
|
13
|
+
"os": [
|
|
14
|
+
"linux",
|
|
15
|
+
"darwin"
|
|
16
|
+
],
|
|
17
|
+
"cpu": [
|
|
18
|
+
"x64",
|
|
19
|
+
"arm64"
|
|
20
|
+
]
|
|
21
|
+
}
|