@webywz/vibe-commit 0.1.5 → 0.1.6
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/dist/cli.js +7 -4
- package/dist/heuristic.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
2
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import { formatCommit } from "./format.js";
|
|
7
7
|
import { commitWithMessage, GitError, inspectStaged } from "./git.js";
|
|
@@ -148,11 +148,14 @@ function isDirectRun() {
|
|
|
148
148
|
const entry = process.argv[1];
|
|
149
149
|
if (!entry)
|
|
150
150
|
return false;
|
|
151
|
+
const self = fileURLToPath(import.meta.url);
|
|
151
152
|
try {
|
|
152
|
-
|
|
153
|
+
// npm/.bin and npx invoke via symlink; compare real paths (align agent-trace / context-diet).
|
|
154
|
+
return (realpathSync(entry) === self ||
|
|
155
|
+
realpathSync(entry) === realpathSync(self));
|
|
153
156
|
}
|
|
154
157
|
catch {
|
|
155
|
-
return
|
|
158
|
+
return /(cli\.(js|ts)|vibe-commit)$/.test(entry);
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
if (isDirectRun()) {
|
package/dist/heuristic.js
CHANGED
|
@@ -246,7 +246,7 @@ export function formatBreakingReason(kind) {
|
|
|
246
246
|
case "major-bump":
|
|
247
247
|
return "major bump · package.json 主版本升级";
|
|
248
248
|
case "footer":
|
|
249
|
-
return "BREAKING CHANGE footer in diff";
|
|
249
|
+
return "BREAKING CHANGE footer in diff · 变更中含 BREAKING CHANGE 页脚";
|
|
250
250
|
case "forced":
|
|
251
251
|
return "forced via --breaking · --breaking 强制";
|
|
252
252
|
}
|