fix(desktop): use execWithShellEnv for gh CLI in import from PR#1577
Conversation
getPrInfo was using execFileAsync with getGitEnv() to call `gh pr view`, which doesn't have the ENOENT retry logic needed on macOS when the app is launched from Finder/Dock (minimal PATH). Switch to execWithShellEnv which lazily derives the user's shell PATH on command-not-found, matching the pattern used by other gh CLI calls in github.ts and git-operations.ts.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe change replaces direct Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
ghCLI not being found when importing a PR on macOS (app launched from Finder/Dock)getPrInfo()was the onlyghcall using rawexecFileAsync+getGitEnv(), which lacks the ENOENT retry logic that resolves the user's shell PATHexecWithShellEnv, matching the pattern used by all otherghcalls in the codebaseChanges
apps/desktop/src/lib/trpc/routers/workspaces/utils/git.ts: ReplaceexecFileAsync("gh", ...)withexecWithShellEnv("gh", ...)ingetPrInfo(), removing the now-unnecessarygetGitEnv()callTest Plan
ghCLI and fetches PR info successfullySummary by CodeRabbit