#13666: test: make docker-setup Bash path portable on Windows
docker
stale
Cluster:
Windows Compatibility Fixes
Fixes CI on Windows runners where /bin/bash doesn't exist (spawnSync returned status=null). Uses 'bash' on win32 and gracefully no-ops if bash isn't available.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Changed the Bash 3.2 compatibility test to use `bash` instead of `/bin/bash` on Windows (where `/bin/bash` doesn't exist), and added graceful handling for environments where bash isn't available at all.
- Made bash path platform-specific: uses `bash` on win32, `/bin/bash` elsewhere
- Added null check to skip the compatibility test when bash isn't available (when `spawnSync` returns `status === null`)
- Fixes CI failures on Windows runners where the hardcoded `/bin/bash` path caused the test to fail
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The changes are minimal, well-scoped, and defensive. The PR only modifies test code (not production code), uses proper platform detection, and adds graceful handling for missing bash. The logic is straightforward and doesn't introduce any new dependencies or breaking changes.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13848: fix(test): normalize paths in source-display test for windows
by gengmao · 2026-02-11
79.2%
#13873: fix(sandbox): prevent Windows PATH from poisoning docker exec
by alessandrorodi · 2026-02-11
78.4%
#3240: Fix Docker build failures on Windows/WSL environments
by Attili-sys · 2026-01-28
76.3%
#7507: test(ci): make tests cross-platform (Windows) + add basic sanitizat...
by ThinkIbrokeIt · 2026-02-02
76.2%
#10708: fix: handle Windows PATH case-sensitivity in exec environment
by Yida-Dev · 2026-02-06
76.1%
#12871: fix: use bash and warn about shell injection (issue #12836)
by ambicuity · 2026-02-09
75.2%
#9250: Fix: Add shell:true for Windows .cmd files to prevent spawn EINVAL ...
by vishaltandale00 · 2026-02-05
75.0%
#7342: fix(docker): ensure readability of docker-setup.sh
by esc-ouni · 2026-02-02
74.9%
#21733: security(exec): platform-aware allowlist matching and restricted sa...
by Esubaalew · 2026-02-20
74.5%
#5168: Fix: force UTF-8 for Windows exec
by ManojINaik · 2026-01-31
74.1%