|
|
@@ -1,33 +1,46 @@
|
|
|
$file_name = Read-Host "file_name "
|
|
|
|
|
|
-Write-Host "linux amd64"
|
|
|
-$env:GOOS = "linux"
|
|
|
-$env:GOARCH = "amd64"
|
|
|
-$env:CGO_ENABLED = 0
|
|
|
-go build $file_name.go
|
|
|
-Remove-Item ".\bin\$file_name.amd64.bin"
|
|
|
-Move-Item "opennamu" ".\bin\$file_name.amd64.bin"
|
|
|
+$to = $args[0]
|
|
|
+if($to -eq $null) {
|
|
|
+ $to = "all"
|
|
|
+}
|
|
|
|
|
|
-Write-Host "linux arm64"
|
|
|
-$env:GOOS = "linux"
|
|
|
-$env:GOARCH = "arm64"
|
|
|
-$env:CGO_ENABLED = 0
|
|
|
-go build $file_name.go
|
|
|
-Remove-Item ".\bin\$file_name.arm64.bin"
|
|
|
-Move-Item "opennamu" ".\bin\$file_name.arm64.bin"
|
|
|
+if($to -eq "linux_amd64" -or $to -eq "all") {
|
|
|
+ Write-Host "linux amd64"
|
|
|
+ $env:GOOS = "linux"
|
|
|
+ $env:GOARCH = "amd64"
|
|
|
+ $env:CGO_ENABLED = 0
|
|
|
+ go build $file_name.go
|
|
|
+ Remove-Item ".\bin\$file_name.amd64.bin"
|
|
|
+ Move-Item "opennamu" ".\bin\$file_name.amd64.bin"
|
|
|
+}
|
|
|
|
|
|
-Write-Host "windows amd64"
|
|
|
-$env:GOOS = "windows"
|
|
|
-$env:GOARCH = "amd64"
|
|
|
-$env:CGO_ENABLED = 0
|
|
|
-go build $file_name.go
|
|
|
-Remove-Item ".\bin\$file_name.amd64.exe"
|
|
|
-Move-Item "opennamu.exe" ".\bin\$file_name.amd64.exe"
|
|
|
+if($to -eq "linux_arm64" -or $to -eq "all") {
|
|
|
+ Write-Host "linux arm64"
|
|
|
+ $env:GOOS = "linux"
|
|
|
+ $env:GOARCH = "arm64"
|
|
|
+ $env:CGO_ENABLED = 0
|
|
|
+ go build $file_name.go
|
|
|
+ Remove-Item ".\bin\$file_name.arm64.bin"
|
|
|
+ Move-Item "opennamu" ".\bin\$file_name.arm64.bin"
|
|
|
+}
|
|
|
|
|
|
-Write-Host "windows arm64"
|
|
|
-$env:GOOS = "windows"
|
|
|
-$env:GOARCH = "arm64"
|
|
|
-$env:CGO_ENABLED = 0
|
|
|
-go build $file_name.go
|
|
|
-Remove-Item ".\bin\$file_name.arm64.exe"
|
|
|
-Move-Item "opennamu.exe" ".\bin\$file_name.arm64.exe"
|
|
|
+if($to -eq "windows_amd64" -or $to -eq "all") {
|
|
|
+ Write-Host "windows amd64"
|
|
|
+ $env:GOOS = "windows"
|
|
|
+ $env:GOARCH = "amd64"
|
|
|
+ $env:CGO_ENABLED = 0
|
|
|
+ go build $file_name.go
|
|
|
+ Remove-Item ".\bin\$file_name.amd64.exe"
|
|
|
+ Move-Item "opennamu.exe" ".\bin\$file_name.amd64.exe"
|
|
|
+}
|
|
|
+
|
|
|
+if($to -eq "windows_arm64" -or $to -eq "all") {
|
|
|
+ Write-Host "windows arm64"
|
|
|
+ $env:GOOS = "windows"
|
|
|
+ $env:GOARCH = "arm64"
|
|
|
+ $env:CGO_ENABLED = 0
|
|
|
+ go build $file_name.go
|
|
|
+ Remove-Item ".\bin\$file_name.arm64.exe"
|
|
|
+ Move-Item "opennamu.exe" ".\bin\$file_name.arm64.exe"
|
|
|
+}
|