@axelgar/opentree 0.0.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/opentree +43 -0
- package/package.json +29 -0
package/bin/opentree
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
|
|
9
|
+
const PLATFORM_PACKAGES = {
|
|
10
|
+
"linux-x64": "@axelgar/opentree-linux-x64",
|
|
11
|
+
"linux-arm64": "@axelgar/opentree-linux-arm64",
|
|
12
|
+
"darwin-x64": "@axelgar/opentree-darwin-x64",
|
|
13
|
+
"darwin-arm64": "@axelgar/opentree-darwin-arm64",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const platform = `${os.platform()}-${os.arch()}`;
|
|
17
|
+
const packageName = PLATFORM_PACKAGES[platform];
|
|
18
|
+
|
|
19
|
+
if (!packageName) {
|
|
20
|
+
console.error(
|
|
21
|
+
`opentree: unsupported platform "${platform}". ` +
|
|
22
|
+
`Supported platforms: ${Object.keys(PLATFORM_PACKAGES).join(", ")}.`
|
|
23
|
+
);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let binaryPath;
|
|
28
|
+
try {
|
|
29
|
+
// Resolve the binary from the platform-specific optional dependency
|
|
30
|
+
binaryPath = require.resolve(`${packageName}/bin/opentree`);
|
|
31
|
+
} catch {
|
|
32
|
+
console.error(
|
|
33
|
+
`opentree: could not find binary for platform "${platform}". ` +
|
|
34
|
+
`Try reinstalling: npm install @axelgar/opentree`
|
|
35
|
+
);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
41
|
+
} catch (/** @type {any} */ err) {
|
|
42
|
+
process.exit(err.status ?? 1);
|
|
43
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@axelgar/opentree",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Git worktree manager CLI for orchestrating parallel AI coding sessions",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/axelgar/opentree.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/axelgar/opentree",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bin": {
|
|
12
|
+
"opentree": "bin/opentree"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin/opentree"
|
|
16
|
+
],
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@axelgar/opentree-linux-x64": "0.0.0",
|
|
19
|
+
"@axelgar/opentree-linux-arm64": "0.0.0",
|
|
20
|
+
"@axelgar/opentree-darwin-x64": "0.0.0",
|
|
21
|
+
"@axelgar/opentree-darwin-arm64": "0.0.0"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|