@0xbigboss/linear-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.
- package/bin.js +41 -0
- package/package.json +16 -0
package/bin.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawnSync } = require("child_process");
|
|
3
|
+
const { join, dirname } = require("path");
|
|
4
|
+
const { existsSync } = require("fs");
|
|
5
|
+
|
|
6
|
+
const PLATFORMS = {
|
|
7
|
+
"darwin-arm64": "@0xbigboss/linear-cli-darwin-arm64",
|
|
8
|
+
"darwin-x64": "@0xbigboss/linear-cli-darwin-x64",
|
|
9
|
+
"linux-x64": "@0xbigboss/linear-cli-linux-x64",
|
|
10
|
+
"linux-arm64": "@0xbigboss/linear-cli-linux-arm64",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const key = `${process.platform}-${process.arch}`;
|
|
14
|
+
const pkg = PLATFORMS[key];
|
|
15
|
+
|
|
16
|
+
if (!pkg) {
|
|
17
|
+
console.error(`Unsupported platform: ${key}`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let bin;
|
|
22
|
+
|
|
23
|
+
// Try installed npm package first
|
|
24
|
+
try {
|
|
25
|
+
const pkgPath = require.resolve(`${pkg}/package.json`);
|
|
26
|
+
bin = join(dirname(pkgPath), "linear");
|
|
27
|
+
} catch {
|
|
28
|
+
// Fall back to local development path
|
|
29
|
+
const localPath = join(__dirname, "..", `linear-cli-${key}`, "linear");
|
|
30
|
+
if (existsSync(localPath)) {
|
|
31
|
+
bin = localPath;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!bin || !existsSync(bin)) {
|
|
36
|
+
console.error(`Binary not found for ${key}. Run: zig build npm`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
41
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@0xbigboss/linear-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Linear CLI built with Zig",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "https://github.com/0xbigboss/linear-cli",
|
|
7
|
+
"bin": {
|
|
8
|
+
"linear": "bin.js"
|
|
9
|
+
},
|
|
10
|
+
"optionalDependencies": {
|
|
11
|
+
"@0xbigboss/linear-cli-darwin-arm64": "0.1.0",
|
|
12
|
+
"@0xbigboss/linear-cli-darwin-x64": "0.1.0",
|
|
13
|
+
"@0xbigboss/linear-cli-linux-x64": "0.1.0",
|
|
14
|
+
"@0xbigboss/linear-cli-linux-arm64": "0.1.0"
|
|
15
|
+
}
|
|
16
|
+
}
|