Skip to content

Commit 93ef040

Browse files
JonZeollaclaude
andcommitted
fix: use .bat wrapper for docker so Task's mvdan/sh finds it on Windows
Task's Go-based shell (mvdan/sh) uses os/exec.LookPath which only finds files with Windows-recognized extensions (.exe, .bat, .cmd). Replace the bash wrapper with a .bat file that routes docker commands through WSL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2f9b748 commit 93ef040

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,10 @@ jobs:
228228
service docker start
229229
"
230230
231-
# Create a docker wrapper so Task commands use WSL's Docker.
232-
# Pass --cd with the converted CWD so docker build contexts resolve.
231+
# Create a .bat wrapper so Task's shell (mvdan/sh) finds it on Windows.
232+
# WSL auto-translates the inherited CWD from Windows to /mnt/ paths.
233233
mkdir -p "$HOME/bin"
234-
cat > "$HOME/bin/docker" << 'WRAPPER'
235-
#!/bin/bash
236-
# Convert Windows CWD to WSL /mnt/ path
237-
win_cwd="$(pwd -W 2>/dev/null || pwd)"
238-
drive="$(echo "${win_cwd:0:1}" | tr '[:upper:]' '[:lower:]')"
239-
rest="${win_cwd:3}"
240-
wsl_cwd="/mnt/$drive/$(echo "$rest" | tr '\\' '/')"
241-
exec wsl -d Ubuntu-24.04 -u root --cd "$wsl_cwd" -- docker "$@"
242-
WRAPPER
243-
chmod +x "$HOME/bin/docker"
234+
printf '@wsl -d Ubuntu-24.04 -u root -- docker %%*\r\n' > "$HOME/bin/docker.bat"
244235
echo "$HOME/bin" >> "$GITHUB_PATH"
245236
- name: Initialize generated project
246237
shell: bash

0 commit comments

Comments
 (0)