@zenku/cli 0.1.1
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/zenku.js +42 -0
- package/package.json +18 -0
package/bin/zenku.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require("child_process");
|
|
6
|
+
const { chmodSync } = require("fs");
|
|
7
|
+
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
const arch = process.arch;
|
|
10
|
+
const pkg = `@zenku/cli-${platform}-${arch}`;
|
|
11
|
+
|
|
12
|
+
let binPath;
|
|
13
|
+
try {
|
|
14
|
+
binPath = require.resolve(`${pkg}/zenku`);
|
|
15
|
+
} catch {
|
|
16
|
+
const supported = [
|
|
17
|
+
"darwin-arm64",
|
|
18
|
+
"darwin-x64",
|
|
19
|
+
"linux-arm64",
|
|
20
|
+
"linux-x64",
|
|
21
|
+
];
|
|
22
|
+
console.error(`Unsupported platform: ${platform}-${arch}`);
|
|
23
|
+
console.error(`Supported: ${supported.join(", ")}`);
|
|
24
|
+
console.error(`Install directly: npm i -g @zenku/cli-${platform}-${arch}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Ensure binary is executable (npm doesn't always preserve permissions)
|
|
29
|
+
try {
|
|
30
|
+
chmodSync(binPath, 0o755);
|
|
31
|
+
} catch {}
|
|
32
|
+
|
|
33
|
+
const { status, error } = spawnSync(binPath, process.argv.slice(2), {
|
|
34
|
+
stdio: "inherit",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (error) {
|
|
38
|
+
console.error(`Failed to run zenku: ${error.message}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
process.exit(status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zenku/cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Zenku CLI — manage PocketBase services from the terminal.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"bin": {
|
|
7
|
+
"zenku": "bin/zenku.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin"
|
|
11
|
+
],
|
|
12
|
+
"optionalDependencies": {
|
|
13
|
+
"@zenku/cli-darwin-arm64": "0.1.1",
|
|
14
|
+
"@zenku/cli-darwin-x64": "0.1.1",
|
|
15
|
+
"@zenku/cli-linux-arm64": "0.1.1",
|
|
16
|
+
"@zenku/cli-linux-x64": "0.1.1"
|
|
17
|
+
}
|
|
18
|
+
}
|