diff --git a/scripts/safesightd.ps1 b/scripts/safesightd.ps1 index 63e6f00..e1359af 100644 --- a/scripts/safesightd.ps1 +++ b/scripts/safesightd.ps1 @@ -82,10 +82,12 @@ function Show-Health { } function Invoke-Build { - Write-Info "编译 safesightd.exe ..." + Write-Info "编译 safesightd.exe (windows/amd64) ..." Push-Location $rootDir try { - & go build -o $exePath .\cmd\safesightd + $env:GOOS = "windows" + $env:GOARCH = "amd64" + & go build -ldflags="-s -w" -o $exePath .\cmd\safesightd if ($LASTEXITCODE -ne 0) { throw "go build failed with exit code $LASTEXITCODE" }