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 <willem.jiang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jason
2026-03-24 23:01:45 +08:00
committed by GitHub
parent a9940c391c
commit 067b19af00

View File

@@ -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: