From 43a8d27798ef2c1bfb1ef85618c3a6debc2a3191 Mon Sep 17 00:00:00 2001 From: SiYue <2835601846@qq.com> Date: Fri, 24 Apr 2026 15:53:15 +0800 Subject: [PATCH] build(makefile): make windows recipes shell-safe - avoid backslash line-continuation in Windows build-launcher recipe - replace cmd-specific if-not-exist with PowerShell check in web build-frontend --- Makefile | 7 +------ web/Makefile | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6cc2e48c9..6e9f9351b 100644 --- a/Makefile +++ b/Makefile @@ -207,12 +207,7 @@ build-launcher: @echo "Building picoclaw-launcher for $(PLATFORM)/$(ARCH)..." ifeq ($(OS),Windows_NT) @$(POWERSHELL) "New-Item -ItemType Directory -Force -Path '$(BUILD_DIR)' | Out-Null" - @$(MAKE) -C web build \ - PLATFORM="$(PLATFORM)" \ - ARCH="$(ARCH)" \ - EXT="$(EXT)" \ - OUTPUT="$(CURDIR)/$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)" \ - GO_BUILD_TAGS="$(GO_BUILD_TAGS)" + @$(MAKE) -C web build PLATFORM="$(PLATFORM)" ARCH="$(ARCH)" EXT="$(EXT)" OUTPUT="$(CURDIR)/$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)" GO_BUILD_TAGS="$(GO_BUILD_TAGS)" @$(POWERSHELL) "Copy-Item -LiteralPath '$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)' -Destination '$(BUILD_DIR)/picoclaw-launcher$(EXT)' -Force" else @mkdir -p $(BUILD_DIR) diff --git a/web/Makefile b/web/Makefile index b91c75c61..2e338f2ca 100644 --- a/web/Makefile +++ b/web/Makefile @@ -163,7 +163,7 @@ endif build-frontend: ifeq ($(OS),Windows_NT) - @if not exist "$(FRONTEND_DIR)\node_modules" (echo Installing frontend dependencies... && cd $(FRONTEND_DIR) && pnpm install --frozen-lockfile --store-dir .pnpm-store) else echo Frontend dependencies already installed. + @$(POWERSHELL) "$$frontend='$(FRONTEND_DIR)'; if (-not (Test-Path -LiteralPath ($$frontend + '/node_modules'))) { Write-Host 'Installing frontend dependencies...'; Push-Location $$frontend; try { pnpm install --frozen-lockfile --store-dir .pnpm-store } finally { Pop-Location } } else { Write-Host 'Frontend dependencies already installed.' }" else @if [ ! -d $(FRONTEND_DIR)/node_modules ] || \ [ $(FRONTEND_DIR)/package.json -nt $(FRONTEND_DIR)/node_modules ] || \