fix(cli): properly quote prisma exec path#624
Conversation
|
Claude finished @ymc9's task —— View job PR Review for fix(cli): properly quote prisma exec pathTodo List
Code Review Summary✅ Overall Assessment: APPROVED This is a clean, focused fix that addresses a real security and reliability issue. Detailed Analysis🔧 Change Summary
🛡️ Security Concerns - FIXED
🐛 Bug Fixes
📈 Code Quality
⚡ Performance
🧪 Test Coverage Assessment
Edge Cases Considered✅ Paths with spaces: Recommendations
|
📝 WalkthroughWalkthroughA single-line fix addressing path handling in the Prisma CLI execution utility. The prismaPath variable is now quoted when passed to the Node.js command, preventing shell path splitting when project directories contain spaces. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the ZenStack CLI fails when the project path contains spaces. The issue occurs in the execPrisma function which executes Prisma commands by constructing a shell command string without properly quoting the resolved Prisma executable path.
Changes:
- Added double quotes around the
prismaPathvariable in theexecSynccall to properly handle paths containing spaces
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/cli/src/utils/exec-utils.ts`:
- Line 60: Replace the execSync invocation that runs `node "${prismaPath}"
${args}` with `execFileSync` to avoid shell parsing: change the call in
exec-utils (the `execSync` that references prismaPath and args) to use
`execFileSync('node', [prismaPath, ...args])` and ensure `args` is passed as a
string[] (update callers that currently join arrays into strings so they supply
a string[] instead); also review the fallback `execPackage(\`prisma ${args}\`,
...)` path (used when execFileSync isn't desired) and either convert it
similarly or keep it as the documented fallback but document the difference so
both code paths remain consistent.
fixes #609
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.