From 12ddd1ace3fc2a08661320f89a6aebeae317be29 Mon Sep 17 00:00:00 2001 From: ifsantana Date: Fri, 14 Aug 2026 09:52:45 -0300 Subject: [PATCH] fix: route Makefile recipes through Git Bash on Windows (#253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GNU Make for Windows dispatches recipes through cmd.exe and ignores a Makefile SHELL reassignment for that dispatch, so `./mvnw` and `chmod` fail with "'.' não é reconhecido..." when running `make build`/`make seed` from PowerShell or cmd. Invoke bash.exe explicitly per recipe instead, using its standard Git-for-Windows path rather than relying on `bash` resolving on PATH, since machines with WSL installed can have `bash` resolve to the WSL launcher stub ahead of Git Bash. Verified `make build` completes with BUILD SUCCESS from PowerShell. --- Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dc2c42ae..f6f8cf2d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,16 @@ .PHONY: up down seed logs build test +# GNU Make for Windows dispatches recipes through cmd.exe and does not honor +# a Makefile SHELL reassignment for that dispatch, so cmd chokes on `./mvnw` +# and `chmod`. Route recipes through Git Bash explicitly instead of relying +# on `bash` resolving on PATH — on machines with WSL installed, plain `bash` +# can resolve to the WSL launcher stub ahead of Git Bash. +ifeq ($(OS),Windows_NT) +BASH := "C:/Program Files/Git/bin/bash.exe" +else +BASH := bash +endif + up: docker compose up -d @@ -7,13 +18,13 @@ down: docker compose down seed: - @chmod +x scripts/bootstrap.sh && ./scripts/bootstrap.sh + @$(BASH) -c "chmod +x scripts/bootstrap.sh && ./scripts/bootstrap.sh" build: - ./mvnw install -DskipTests + $(BASH) -c "./mvnw install -DskipTests" test: - ./mvnw verify + $(BASH) -c "./mvnw verify" logs: docker compose logs -f