fix(system): handle ENOENT in checkCommand and throw on unmatched version in getVersion#337
fix(system): handle ENOENT in checkCommand and throw on unmatched version in getVersion#337luch91 wants to merge 1 commit into
Conversation
…sion in getVersion
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo system utility functions gain stricter error handling: ChangesSystem utilities error handling
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 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 |
|
Actionable comments posted: 0 |
|
Fixed in #337 — added error.code === 'ENOENT' to the Fixed in #337 — removed the dead inner try/catch and added |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Fixes #301 and #303.
Bug #301 — checkCommand false positive
When a required binary is not installed, child_process.exec
rejects with error.code === 'ENOENT' and empty stderr. The
previous guard
if (error.stderr)evaluated to false,swallowing the error and reporting the tool as present.
Fixed by adding error.code === 'ENOENT' to the condition.
Bug #303 — getVersion silent empty string
When the version regex didn't match (e.g. stdout was
"Docker version 25" with no X.Y.Z pattern), the function
fell through the dead inner try/catch and returned "".
The caller then ran semver.satisfies("", ">=X.Y.Z") → false,
producing a misleading "please update" error when the tool
was already the correct version.
Fixed by removing the dead try/catch and throwing explicitly
when the regex produces no match. The unreachable return ""
is also removed.
Tests
as correct behavior
506 tests passing, 0 failures.
Summary by CodeRabbit
Bug Fixes
Tests