fix(install): prefer shasum on macOS to avoid BSD sha256sum incompatibility#34
Conversation
…bility BSD sha256sum on macOS does not support --check/--status flags (GNU only). Use $OS (already set by detect_platform) to prefer shasum -a 256 on darwin, falling back to sha256sum on Linux and shasum as a final fallback. Fixes canoo#33
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe checksum verification logic in install.sh's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
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)
Comment |
canoo
left a comment
There was a problem hiding this comment.
Clean fix. Deduplicating the hash extraction and using $OS to prefer shasum on darwin is the right approach. BSD sha256sum lacking --check/--status is a real cross-platform issue.
Problem
Closes #33
install.shfails on macOS at checksum verification:macOS ships a BSD
sha256sumthat does not support--checkor--status(GNU coreutils flags). Sincecommand -v sha256sumsucceeds on macOS, theshasumfallback is never reached.Fix
Use the
$OSvariable (already set bydetect_platform) to prefershasum -a 256ondarwin, then fall back tosha256sumon Linux, withshasumas a final fallback. Also consolidates the duplicatedexpectedhash extraction into a single block.Tested
shasum -a 256sha256sumpath still taken)Summary by CodeRabbit