@caliber-ai/cli 0.20.0 → 0.20.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/dist/bin.js +12 -6
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1514,7 +1514,7 @@ function stageFiles(files, projectDir) {
|
|
|
1514
1514
|
fs15.mkdirSync(path14.dirname(currentPath), { recursive: true });
|
|
1515
1515
|
fs15.copyFileSync(originalPath, currentPath);
|
|
1516
1516
|
modifiedFiles++;
|
|
1517
|
-
stagedFiles.push({ relativePath: file.path, proposedPath, currentPath, isNew: false });
|
|
1517
|
+
stagedFiles.push({ relativePath: file.path, proposedPath, currentPath, originalPath, isNew: false });
|
|
1518
1518
|
} else {
|
|
1519
1519
|
newFiles++;
|
|
1520
1520
|
stagedFiles.push({ relativePath: file.path, proposedPath, isNew: true });
|
|
@@ -1529,7 +1529,7 @@ function cleanupStaging() {
|
|
|
1529
1529
|
}
|
|
1530
1530
|
|
|
1531
1531
|
// src/utils/editor.ts
|
|
1532
|
-
import { execSync as execSync2,
|
|
1532
|
+
import { execSync as execSync2, spawn } from "child_process";
|
|
1533
1533
|
function commandExists(cmd) {
|
|
1534
1534
|
try {
|
|
1535
1535
|
execSync2(`which ${cmd}`, { stdio: "ignore" });
|
|
@@ -1549,10 +1549,16 @@ function openDiffsInEditor(editor, files) {
|
|
|
1549
1549
|
const cmd = editor === "cursor" ? "cursor" : "code";
|
|
1550
1550
|
for (const file of files) {
|
|
1551
1551
|
try {
|
|
1552
|
-
if (file.
|
|
1553
|
-
|
|
1552
|
+
if (file.originalPath) {
|
|
1553
|
+
spawn(cmd, ["--diff", file.originalPath, file.proposedPath], {
|
|
1554
|
+
stdio: "ignore",
|
|
1555
|
+
detached: true
|
|
1556
|
+
}).unref();
|
|
1554
1557
|
} else {
|
|
1555
|
-
|
|
1558
|
+
spawn(cmd, [file.proposedPath], {
|
|
1559
|
+
stdio: "ignore",
|
|
1560
|
+
detached: true
|
|
1561
|
+
}).unref();
|
|
1556
1562
|
}
|
|
1557
1563
|
} catch {
|
|
1558
1564
|
continue;
|
|
@@ -2135,7 +2141,7 @@ async function promptReviewMethod() {
|
|
|
2135
2141
|
function openReview(method, stagedFiles) {
|
|
2136
2142
|
if (method === "cursor" || method === "vscode") {
|
|
2137
2143
|
openDiffsInEditor(method, stagedFiles.map((f) => ({
|
|
2138
|
-
|
|
2144
|
+
originalPath: f.originalPath,
|
|
2139
2145
|
proposedPath: f.proposedPath
|
|
2140
2146
|
})));
|
|
2141
2147
|
console.log(chalk3.dim(" Diffs opened in your editor.\n"));
|