mirror of
https://github.com/tenox7/wrp.git
synced 2024-12-22 06:29:16 +00:00
17 lines
531 B
PowerShell
17 lines
531 B
PowerShell
param (
|
|
[switch]$clean = $false
|
|
)
|
|
foreach($sys in ("amd64-linux", "arm-linux", "arm-netbsd", "arm-freebsd", "amd64-freebsd", "amd64-openbsd", "amd64-darwin", "amd64-windows")) {
|
|
$cpu,$os = $sys.split('-')
|
|
$env:GOARCH=$cpu
|
|
$env:GOOS=$os
|
|
$o="wrp-$cpu-$(if ($os -eq "windows") {$os="windows.exe"} elseif ($os -eq "darwin") { $os="macos" })$os"
|
|
Remove-Item -ErrorAction Ignore $o
|
|
if (!$clean) {
|
|
$cmd = "& go build -a -o $o wrp.go"
|
|
Write-Host $cmd
|
|
Invoke-Expression $cmd
|
|
}
|
|
}
|
|
|