mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Fix Windows build flow
This commit is contained in:
+1
-1
@@ -164,7 +164,7 @@ endif
|
||||
|
||||
build-frontend:
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@$(POWERSHELL) "if ((-not (Test-Path -LiteralPath '$(FRONTEND_DIR)/node_modules')) -or (-not (Test-Path -LiteralPath '$(FRONTEND_DIR)/node_modules/.bin/tsc')) -or (-not (Test-Path -LiteralPath '$(FRONTEND_INSTALL_STAMP)')) -or ((Get-Content -LiteralPath '$(FRONTEND_INSTALL_STAMP)' -Raw).Trim() -ne (((Get-FileHash -LiteralPath '$(FRONTEND_DIR)/package.json' -Algorithm SHA256).Hash + ':' + (Get-FileHash -LiteralPath '$(FRONTEND_DIR)/pnpm-lock.yaml' -Algorithm SHA256).Hash)))) { Write-Host 'Installing frontend dependencies...'; Push-Location '$(FRONTEND_DIR)'; try { pnpm install --frozen-lockfile } finally { Pop-Location }; Set-Content -LiteralPath '$(FRONTEND_INSTALL_STAMP)' -Value (((Get-FileHash -LiteralPath '$(FRONTEND_DIR)/package.json' -Algorithm SHA256).Hash + ':' + (Get-FileHash -LiteralPath '$(FRONTEND_DIR)/pnpm-lock.yaml' -Algorithm SHA256).Hash)) -NoNewline }"
|
||||
@$(POWERSHELL) "$$frontend='$(FRONTEND_DIR)'; $$stamp='$(FRONTEND_INSTALL_STAMP)'; $$pkg='$(FRONTEND_DIR)/package.json'; $$lock='$(FRONTEND_DIR)/pnpm-lock.yaml'; $$expected=((Get-FileHash -LiteralPath $$pkg -Algorithm SHA256).Hash + ':' + (Get-FileHash -LiteralPath $$lock -Algorithm SHA256).Hash); $$nodeModules=$$frontend + '/node_modules'; $$tsc=$$nodeModules + '/.bin/tsc'; $$current=''; if (Test-Path -LiteralPath $$stamp) { $$current=(Get-Content -LiteralPath $$stamp -Raw).Trim() }; if ((-not (Test-Path -LiteralPath $$nodeModules)) -or (-not (Test-Path -LiteralPath $$tsc)) -or ($$current -ne $$expected)) { Write-Host 'Installing frontend dependencies...'; Push-Location $$frontend; try { $$env:CI='true'; pnpm install --frozen-lockfile } finally { Pop-Location; Remove-Item Env:CI -ErrorAction SilentlyContinue }; Set-Content -LiteralPath $$stamp -Value $$expected -NoNewline }"
|
||||
else
|
||||
@expected_stamp="$$(cat $(FRONTEND_DIR)/package.json $(FRONTEND_DIR)/pnpm-lock.yaml | cksum | awk '{print $$1 ":" $$2}')"; \
|
||||
if [ ! -d $(FRONTEND_DIR)/node_modules ] || \
|
||||
|
||||
Reference in New Issue
Block a user