mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-28 11:16:37 +08:00
21 lines
605 B
PowerShell
Vendored
21 lines
605 B
PowerShell
Vendored
param(
|
|
[string]$Output = "bin/mediastation-go-protected.exe",
|
|
[switch]$Garble
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$env:CGO_ENABLED = "0"
|
|
|
|
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $Output) | Out-Null
|
|
|
|
if ($Garble) {
|
|
if (-not (Get-Command garble -ErrorAction SilentlyContinue)) {
|
|
throw "garble is not installed. Run: go install mvdan.cc/garble@latest"
|
|
}
|
|
garble -literals -tiny build -trimpath -ldflags="-s -w -buildid=" -o $Output ./cmd/server
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
go build -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -o $Output ./cmd/server
|
|
exit $LASTEXITCODE
|