ralph-mcp 1.0.6 → 1.0.7
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/utils/worktree.js +15 -2
- package/package.json +1 -1
package/dist/utils/worktree.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execSync, exec } from "child_process";
|
|
2
|
-
import { existsSync, appendFileSync } from "fs";
|
|
2
|
+
import { existsSync, appendFileSync, readFileSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { promisify } from "util";
|
|
5
5
|
const execAsync = promisify(exec);
|
|
@@ -27,8 +27,21 @@ export async function createWorktree(projectRoot, branch) {
|
|
|
27
27
|
}
|
|
28
28
|
// Prevent ralph-progress.md from being committed
|
|
29
29
|
try {
|
|
30
|
-
const
|
|
30
|
+
const { stdout: gitCommonDir } = await execAsync("git rev-parse --git-common-dir", {
|
|
31
|
+
cwd: worktreePath,
|
|
32
|
+
});
|
|
33
|
+
const excludePath = join(gitCommonDir.trim(), "info", "exclude");
|
|
34
|
+
// Ensure info directory exists
|
|
35
|
+
// (git-common-dir usually returns absolute path or relative to cwd.
|
|
36
|
+
// If relative, join with worktreePath might be needed, but rev-parse usually returns absolute if outside?
|
|
37
|
+
// Actually rev-parse --git-common-dir usually returns absolute path if called with proper context or relative.
|
|
38
|
+
// Safest is to resolve it.)
|
|
39
|
+
// Let's rely on reading current content to check if needed
|
|
40
|
+
let content = "";
|
|
31
41
|
if (existsSync(excludePath)) {
|
|
42
|
+
content = readFileSync(excludePath, "utf-8");
|
|
43
|
+
}
|
|
44
|
+
if (!content.includes("ralph-progress.md")) {
|
|
32
45
|
appendFileSync(excludePath, "\nralph-progress.md\n", "utf-8");
|
|
33
46
|
}
|
|
34
47
|
}
|
package/package.json
CHANGED