fix: support spaces in --user-name for non-interactive install#2088
Conversation
Replace execSync with execFileSync in npx wrapper so that argument values containing spaces (e.g. --user-name "CI Bot") are passed as discrete array elements instead of being split by the shell. Fixes bmad-code-org#2066 Signed-off-by: majiayu000 <1835304752@qq.com>
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaced synchronous shell-based subprocess invocation with direct executable invocation using an argument array, eliminating shell-style string interpolation to preserve arguments with spaces and special characters. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 Tip CodeRabbit can use your project's `biome` configuration to improve the quality of JS/TS/CSS/JSON code reviews.Add a configuration file to your project to customize how CodeRabbit runs |
|
thank you! |
What
Replace
execSyncwithexecFileSyncin the npx wrapper so CLI arguments containing spaces are preserved.Why
Fixes #2066 —
--user-name "CI Bot"was broken becauseargs.join(' ')collapsed quoted arguments into separate tokens when passed through shell parsing.How
execSync(string command) toexecFileSync(array arguments) intools/bmad-npx-wrapper.jsexecFileSyncbypasses shell parsing, preserving argument boundaries exactly as passedTesting
npm run test:install— all 227 tests passexecFileSync('node', [bmadCliPath, ...args], opts)preserves spaces in--user-name "CI Bot"by avoiding shell tokenization