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
This commit is contained in:
parent
83c79087cd
commit
43a8d27798
2 changed files with 2 additions and 7 deletions
7
Makefile
7
Makefile
|
|
@ -207,12 +207,7 @@ build-launcher:
|
||||||
@echo "Building picoclaw-launcher for $(PLATFORM)/$(ARCH)..."
|
@echo "Building picoclaw-launcher for $(PLATFORM)/$(ARCH)..."
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
@$(POWERSHELL) "New-Item -ItemType Directory -Force -Path '$(BUILD_DIR)' | Out-Null"
|
@$(POWERSHELL) "New-Item -ItemType Directory -Force -Path '$(BUILD_DIR)' | Out-Null"
|
||||||
@$(MAKE) -C web build \
|
@$(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)"
|
||||||
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"
|
@$(POWERSHELL) "Copy-Item -LiteralPath '$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)' -Destination '$(BUILD_DIR)/picoclaw-launcher$(EXT)' -Force"
|
||||||
else
|
else
|
||||||
@mkdir -p $(BUILD_DIR)
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ endif
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
ifeq ($(OS),Windows_NT)
|
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
|
else
|
||||||
@if [ ! -d $(FRONTEND_DIR)/node_modules ] || \
|
@if [ ! -d $(FRONTEND_DIR)/node_modules ] || \
|
||||||
[ $(FRONTEND_DIR)/package.json -nt $(FRONTEND_DIR)/node_modules ] || \
|
[ $(FRONTEND_DIR)/package.json -nt $(FRONTEND_DIR)/node_modules ] || \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue