Fixes #16.
This commit is contained in:
parent
9014d45ce8
commit
2fa0d652db
2 changed files with 18 additions and 4 deletions
|
@ -1,19 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
TAG=$(git tag --sort=-version:refname | head -n 1)
|
||||
|
||||
go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo
|
||||
|
||||
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath &&
|
||||
GOOS=windows GOARCH=386 go build -ldflags="-s -w -X main.tag=$TAG" -trimpath &&
|
||||
zip -9 zenity_win32.zip zenity.exe &&
|
||||
rm zenity.exe
|
||||
|
||||
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath &&
|
||||
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X main.tag=$TAG" -trimpath &&
|
||||
zip -9 zenity_win64.zip zenity.exe &&
|
||||
rm zenity.exe
|
||||
|
||||
rm resource.syso
|
||||
|
||||
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o zenity_macos_x64 &&
|
||||
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o zenity_macos_arm &&
|
||||
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X main.tag=$TAG" -trimpath -o zenity_macos_x64 &&
|
||||
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X main.tag=$TAG" -trimpath -o zenity_macos_arm &&
|
||||
go run github.com/randall77/makefat zenity zenity_macos_x64 zenity_macos_arm &&
|
||||
zip -9 zenity_macos.zip zenity &&
|
||||
rm zenity zenity_macos_*
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"image/color"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
@ -23,6 +24,8 @@ const (
|
|||
unspecified = "\x00"
|
||||
)
|
||||
|
||||
var tag = "v0.0.0"
|
||||
|
||||
var (
|
||||
// Application Options
|
||||
errorDlg bool
|
||||
|
@ -88,6 +91,9 @@ var (
|
|||
unixeol bool
|
||||
cygpath bool
|
||||
wslpath bool
|
||||
|
||||
// Command options
|
||||
version bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -233,6 +239,7 @@ func setupFlags() {
|
|||
}
|
||||
|
||||
// Command options
|
||||
flag.BoolVar(&version, "version", false, "Show version of program")
|
||||
flag.IntVar(&zenutil.Timeout, "timeout", 0, "Set dialog `timeout` in seconds")
|
||||
flag.StringVar(&zenutil.Separator, "separator", "|", "Set output `separator` character")
|
||||
|
||||
|
@ -247,6 +254,11 @@ func setupFlags() {
|
|||
|
||||
func validateFlags() {
|
||||
var n int
|
||||
if version {
|
||||
fmt.Printf("zenity %s %s/%s\n", tag, runtime.GOOS, runtime.GOARCH)
|
||||
fmt.Println("https://github.com/ncruces/zenity")
|
||||
os.Exit(0)
|
||||
}
|
||||
if errorDlg {
|
||||
n++
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue