From b313e703fbffca15fad7e07c53e3706dce562f68 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Tue, 16 Jul 2019 23:30:40 -0700 Subject: [PATCH] fixes for ps build --- make.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/make.ps1 b/make.ps1 index 4e718ce..6e2aac2 100644 --- a/make.ps1 +++ b/make.ps1 @@ -1,9 +1,20 @@ +param ( + [switch]$clean = $false +) $env:GOARCH="amd64" foreach($os in ("linux", "freebsd", "openbsd", "darwin", "windows")) { $env:GOOS=$os - Invoke-Expression "& go build -a -o wrp-$(if ($os -eq "windows") {$os="windows.exe"})$os wrp.go" + $o="wrp-$(if ($os -eq "windows") {$os="windows.exe"})$os" + Remove-Item -ErrorAction Ignore $o + if (!$clean) { + Invoke-Expression "& go build -a -o $o wrp.go" + } } $env:GOARCH="arm" $env:GOOS="linux" -Invoke-Expression "& go build -a -o wrp-linux-rpi wrp.go" \ No newline at end of file +$o="wrp-linux-rpi" +Remove-Item -ErrorAction Ignore $o +if (!$clean) { + Invoke-Expression "& go build -a -o $o wrp.go" +}