fix: add Windows Git Bash fallbacks for uname, date, and cat#11
Open
sampurnamo wants to merge 1 commit intoConaryLabs:mainfrom
Open
fix: add Windows Git Bash fallbacks for uname, date, and cat#11sampurnamo wants to merge 1 commit intoConaryLabs:mainfrom
sampurnamo wants to merge 1 commit intoConaryLabs:mainfrom
Conversation
In restricted shell contexts on Windows (Git Bash within hooks), core utilities like uname, date, and cat may not be in PATH. Changes: - Guard all uname -s calls with 2>/dev/null || echo "Windows" - Guard all uname -m calls with 2>/dev/null || echo "x86_64" - Guard all date +%s calls with 2>/dev/null fallback to mtime - Guard all cat calls with 2>/dev/null || echo "" fallback - Add Windows* pattern to all OS case statements - Add x86_64 default for architecture detection
Contributor
Code reviewFound 1 issue:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In restricted shell contexts on Windows (Git Bash running within hook processes), core POSIX utilities like
uname,date, andcatmay not be available in$PATH. This causes the mira-wrapper to fail with errors like:This PR guards all shell utility calls with
2>/dev/nullfallbacks:uname -s: Falls back to"Windows"— safe default that triggers Windows code pathsuname -m: Falls back to"x86_64"— most common Windows architecturedate +%s: Falls back to the file mtime being compared — producescache_age=0, which means "cache is fresh" (safe: skips unnecessary update checks)cat: Falls back to""— triggers re-download path (safe)Windows*pattern added to allcasestatements that lacked itTest plan
install_jq()handles Windows detection correctlyReplaces #10 (which had merge conflicts from fork divergence).