From 067b19af00b9a5a7895cecf6073a571cd91fcf33 Mon Sep 17 00:00:00 2001 From: Jason <101583541+JasonOA888@users.noreply.github.com> Date: Tue, 24 Mar 2026 23:01:45 +0800 Subject: [PATCH] fix: add Windows compatibility for make dev/start commands (#1297) * fix: add Windows compatibility for make dev/start commands On Windows with MinGW/Git Bash, the Makefile's direct shell script execution fails with 'CreateProcess(NULL, env bash ...)' error. This fix: - Detects Windows via $(OS) == Windows_NT - Uses explicit bash invocation on Windows - Falls back to direct execution on Unix Users need Git Bash installed (comes with Git for Windows). Fixes #1288 Related #1278 * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Willem Jiang Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 2beffd2..8833dd0 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,12 @@ .PHONY: help config config-upgrade check install dev dev-daemon start stop up down clean docker-init docker-start docker-stop docker-logs docker-logs-frontend docker-logs-gateway PYTHON ?= python +BASH ?= bash + +# Detect OS for Windows compatibility +ifeq ($(OS),Windows_NT) + SHELL := cmd.exe +endif help: @echo "DeerFlow Development Commands:" @@ -90,11 +96,21 @@ setup-sandbox: # Start all services in development mode (with hot-reloading) dev: +ifeq ($(OS),Windows_NT) + @echo "Detected Windows - using Git Bash..." + @$(BASH) ./scripts/serve.sh --dev +else @./scripts/serve.sh --dev +endif # Start all services in production mode (with optimizations) start: +ifeq ($(OS),Windows_NT) + @echo "Detected Windows - using Git Bash..." + @$(BASH) ./scripts/serve.sh --prod +else @./scripts/serve.sh --prod +endif # Start all services in daemon mode (background) dev-daemon: