Skip to content

Commit 0e1225b

Browse files
committed
fix the build
1 parent 93a8549 commit 0e1225b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SHELL=/bin/sh
2+
3+
dist:
4+
goreleaser check
5+
goreleaser release --snapshot --clean
6+
.PHONY: dist
7+

cmd/sheets-refresh/main.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ import (
1515
"google.golang.org/api/sheets/v4"
1616
)
1717

18-
var build = ""
18+
var (
19+
build = ""
20+
version = ""
21+
)
1922

2023
var exepath = filepath.Dir(os.Args[0])
2124

@@ -25,7 +28,7 @@ var (
2528
"this will trigger reauthentication")
2629
jobConfig = flag.String("job", "", "configuration `file` with job definition")
2730
consoleAuth = flag.Bool("console", false, "use text authentication prompts instead of opening browser")
28-
version = flag.Bool("version", false, "print program version and quit")
31+
ver = flag.Bool("version", false, "print program version and quit")
2932

3033
defaultCredentialsFile = filepath.Join(exepath, ".refresh-credentials.json")
3134
credentials = flag.String("auth", defaultCredentialsFile, "file with authentication data")
@@ -41,8 +44,8 @@ func mustStr(s string, err error) string {
4144
func main() {
4245
flag.Parse()
4346

44-
if *version {
45-
fmt.Println(build)
47+
if *ver {
48+
fmt.Printf("%s (%s)", version, build)
4649
os.Exit(0)
4750
}
4851

0 commit comments

Comments
 (0)