fix: correct sudo usage in node installer#21
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIn ChangesRoot/Non-root Node Installation Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Summary
Fix root/non-root handling in
install_node_command().Problem
The current implementation invokes
sudowhen already running as root and runs the installer directly when not running as root:This causes node installation to fail on systems where
sudois not installed.Reproduction
Environment:
sudopackage not installedCommand:
Output:
Verification
After applying this patch:
The installer proceeds normally and reaches the next installation steps.
Solution
sudoonly for non-root users.Additionally,
pg-node.shalready performs multiplecheck_running_as_rootchecks, so this change aligns the invocation logic with the installer requirements.Summary by CodeRabbit