@ai-git/cli 0.0.0 → 2.6.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/ai-git +13 -3
- package/package.json +6 -6
- package/scripts/postinstall.js +4 -2
package/bin/ai-git
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { execFileSync } = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
4
5
|
const path = require("path");
|
|
5
6
|
const os = require("os");
|
|
6
7
|
|
|
@@ -12,13 +13,13 @@ const PLATFORMS = {
|
|
|
12
13
|
|
|
13
14
|
const platformPkgs = PLATFORMS[os.platform()];
|
|
14
15
|
if (!platformPkgs) {
|
|
15
|
-
console.error(`
|
|
16
|
+
console.error(`ai-git: unsupported platform: ${os.platform()}-${os.arch()}`);
|
|
16
17
|
process.exit(1);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const pkg = platformPkgs[os.arch()];
|
|
20
21
|
if (!pkg) {
|
|
21
|
-
console.error(`
|
|
22
|
+
console.error(`ai-git: unsupported architecture: ${os.platform()}-${os.arch()}`);
|
|
22
23
|
process.exit(1);
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -29,10 +30,19 @@ const bin = path.join(
|
|
|
29
30
|
`ai-git${ext}`,
|
|
30
31
|
);
|
|
31
32
|
|
|
33
|
+
if (!fs.existsSync(bin)) {
|
|
34
|
+
console.error(
|
|
35
|
+
`ai-git: binary not found at ${bin}\n` +
|
|
36
|
+
`The platform package (${pkg}) may not contain a binary yet.\n` +
|
|
37
|
+
`Try reinstalling: npm install -g @ai-git/cli`
|
|
38
|
+
);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
try {
|
|
33
43
|
execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
34
44
|
} catch (e) {
|
|
35
|
-
if (e && typeof e === "object" && "status" in e) {
|
|
45
|
+
if (e && typeof e === "object" && "status" in e && e.status !== null) {
|
|
36
46
|
process.exit(e.status);
|
|
37
47
|
}
|
|
38
48
|
throw e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-git/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "AI-powered git commit message generator",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"ai-git": "bin/ai-git"
|
|
13
13
|
},
|
|
14
14
|
"optionalDependencies": {
|
|
15
|
-
"@ai-git/darwin-arm64": "
|
|
16
|
-
"@ai-git/darwin-x64": "
|
|
17
|
-
"@ai-git/linux-arm64": "
|
|
18
|
-
"@ai-git/linux-x64": "
|
|
19
|
-
"@ai-git/win32-x64": "
|
|
15
|
+
"@ai-git/darwin-arm64": "2.6.1",
|
|
16
|
+
"@ai-git/darwin-x64": "2.6.1",
|
|
17
|
+
"@ai-git/linux-arm64": "2.6.1",
|
|
18
|
+
"@ai-git/linux-x64": "2.6.1",
|
|
19
|
+
"@ai-git/win32-x64": "2.6.1"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"postinstall": "node scripts/postinstall.js"
|
package/scripts/postinstall.js
CHANGED
|
@@ -22,8 +22,10 @@ function writeMarker() {
|
|
|
22
22
|
}
|
|
23
23
|
fs.mkdirSync(stateDir, { recursive: true });
|
|
24
24
|
fs.writeFileSync(path.join(stateDir, "install-method"), "npm");
|
|
25
|
-
} catch {
|
|
26
|
-
|
|
25
|
+
} catch (err) {
|
|
26
|
+
if (process.env.npm_config_loglevel !== "silent") {
|
|
27
|
+
console.warn(`ai-git: Could not write install method marker: ${err.message}`);
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|