@todoforai/tfa-review 0.1.1 → 0.1.2
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 +9 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3115,11 +3115,19 @@ function readStdinDiff() {
|
|
|
3115
3115
|
}
|
|
3116
3116
|
}
|
|
3117
3117
|
function captureGitDiff(repo, against) {
|
|
3118
|
+
try {
|
|
3119
|
+
execFileSync("git", ["-C", repo, "rev-parse", "--is-inside-work-tree"], { stdio: "ignore" });
|
|
3120
|
+
} catch {
|
|
3121
|
+
console.error(`Not a git repository: ${repo}`);
|
|
3122
|
+
process.exit(1);
|
|
3123
|
+
}
|
|
3118
3124
|
const args = against === "WORKING" ? ["-C", repo, "diff", "HEAD"] : ["-C", repo, "diff", `${against}...HEAD`];
|
|
3119
3125
|
try {
|
|
3120
3126
|
return execFileSync("git", args, { encoding: "utf-8", maxBuffer: 50 * 1024 * 1024 });
|
|
3121
3127
|
} catch (e) {
|
|
3122
|
-
|
|
3128
|
+
const stderr = (e?.stderr?.toString?.() || "").split(`
|
|
3129
|
+
`)[0] || e?.message || String(e);
|
|
3130
|
+
console.error(`git diff failed (${against} in ${repo}): ${stderr}`);
|
|
3123
3131
|
process.exit(1);
|
|
3124
3132
|
}
|
|
3125
3133
|
}
|