Skip to content

Commit 35e6669

Browse files
committed
Integrate goreleaser
1 parent ef6a01f commit 35e6669

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

.goreleaser.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
builds:
2+
- binary: iap_curl
3+
goos:
4+
- darwin
5+
- linux
6+
goarch:
7+
- amd64
8+
ldflags:
9+
- -X main.Version={{.Version}}
10+
archive:
11+
format: zip
12+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
13+
files:
14+
- README.md
15+
release:
16+
github:
17+
owner: b4b4r07
18+
name: iap_curl

main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import (
1414
)
1515

1616
const (
17-
app = "iap_curl"
18-
version = "0.1.1"
17+
// AppName is this tool name
18+
AppName = "iap_curl"
19+
// Version is the version information of this tool
20+
Version = "0.1.2"
1921
)
2022

2123
const help = `iap_curl - curl wrapper for making HTTP request to IAP-protected app
@@ -89,7 +91,7 @@ func (c CLI) exit(msg interface{}) int {
8991
fmt.Fprintf(c.stdout, "%s\n", m)
9092
return 0
9193
case error:
92-
fmt.Fprintf(c.stderr, "[ERROR] %s: %s\n", app, m.Error())
94+
fmt.Fprintf(c.stderr, "[ERROR] %s: %s\n", AppName, m.Error())
9395
return 1
9496
default:
9597
panic(msg)
@@ -102,7 +104,7 @@ func (c CLI) run() int {
102104
}
103105

104106
if c.opt.version {
105-
return c.exit(fmt.Sprintf("%s v%s (runtime: %s)", app, version, runtime.Version()))
107+
return c.exit(fmt.Sprintf("%s v%s (runtime: %s)", AppName, Version, runtime.Version()))
106108
}
107109

108110
if c.opt.list {

0 commit comments

Comments
 (0)