@taranek/orche 0.0.33 → 0.0.34

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 CHANGED
@@ -48,16 +48,20 @@ function deliverReview(pendingPath) {
48
48
  }
49
49
  }
50
50
  async function runReview(worktreePath) {
51
- const resolvedPath = path.resolve(worktreePath);
51
+ const inputPath = path.resolve(worktreePath);
52
52
  // Refuse to run unless the target is inside a git worktree — otherwise the
53
53
  // review app may try to recursively watch enormous trees (e.g. $HOME).
54
+ // Anchor at the worktree root: `git diff --name-status` emits root-relative
55
+ // paths, so the review app must run from the top-level or file reads (which
56
+ // join cwd + path) break when invoked from a subdirectory.
57
+ let resolvedPath;
54
58
  try {
55
- execFileSync("git", ["-C", resolvedPath, "rev-parse", "--show-toplevel"], {
56
- stdio: ["ignore", "pipe", "ignore"],
57
- });
59
+ resolvedPath = execFileSync("git", ["-C", inputPath, "rev-parse", "--show-toplevel"], { stdio: ["ignore", "pipe", "ignore"] })
60
+ .toString()
61
+ .trim();
58
62
  }
59
63
  catch {
60
- die(`not a git worktree: ${resolvedPath}`);
64
+ die(`not a git worktree: ${inputPath}`);
61
65
  }
62
66
  const args = ["--worktree=" + resolvedPath];
63
67
  console.log(`opening review for ${worktreePath}...`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taranek/orche",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "orche": "./dist/cli.js"
package/src/cli.ts CHANGED
@@ -48,16 +48,24 @@ function deliverReview(pendingPath: string): void {
48
48
  }
49
49
 
50
50
  async function runReview(worktreePath: string): Promise<void> {
51
- const resolvedPath = path.resolve(worktreePath);
51
+ const inputPath = path.resolve(worktreePath);
52
52
 
53
53
  // Refuse to run unless the target is inside a git worktree — otherwise the
54
54
  // review app may try to recursively watch enormous trees (e.g. $HOME).
55
+ // Anchor at the worktree root: `git diff --name-status` emits root-relative
56
+ // paths, so the review app must run from the top-level or file reads (which
57
+ // join cwd + path) break when invoked from a subdirectory.
58
+ let resolvedPath: string;
55
59
  try {
56
- execFileSync("git", ["-C", resolvedPath, "rev-parse", "--show-toplevel"], {
57
- stdio: ["ignore", "pipe", "ignore"],
58
- });
60
+ resolvedPath = execFileSync(
61
+ "git",
62
+ ["-C", inputPath, "rev-parse", "--show-toplevel"],
63
+ { stdio: ["ignore", "pipe", "ignore"] },
64
+ )
65
+ .toString()
66
+ .trim();
59
67
  } catch {
60
- die(`not a git worktree: ${resolvedPath}`);
68
+ die(`not a git worktree: ${inputPath}`);
61
69
  }
62
70
 
63
71
  const args = ["--worktree=" + resolvedPath];