1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-10 23:57:43 +02:00

update to use goreleaser ldflags

This commit is contained in:
Jesse Duffield 2018-08-08 22:48:37 +10:00
parent 00c679a3f0
commit 778cb14dc4
2 changed files with 16 additions and 9 deletions

View File

@ -1,8 +1,18 @@
# This is an example goreleaser.yaml file with some sane defaults. # This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com # Make sure to check the documentation at http://goreleaser.com
builds: builds:
- env: env:
- CGO_ENABLED=0 - CGO_ENABLED=0
main: ./main.go
goos:
- freebsd
- windows
- darwin
- linux
goarch:
- amd64
- arm
- arm64
archive: archive:
replacements: replacements:
darwin: Darwin darwin: Darwin

11
main.go
View File

@ -20,13 +20,10 @@ var (
subprocess *exec.Cmd subprocess *exec.Cmd
startTime time.Time startTime time.Time
// Rev - Git Revision commit string
Rev string version = "unversioned"
// Version - Version number date string
Version = "unversioned"
builddate string
debuggingFlag = flag.Bool("debug", false, "a boolean") debuggingFlag = flag.Bool("debug", false, "a boolean")
versionFlag = flag.Bool("v", false, "Print the current version") versionFlag = flag.Bool("v", false, "Print the current version")
) )
@ -77,7 +74,7 @@ func main() {
devLog("\n\n\n\n\n\n\n\n\n\n") devLog("\n\n\n\n\n\n\n\n\n\n")
flag.Parse() flag.Parse()
if *versionFlag { if *versionFlag {
fmt.Printf("rev=%s, build date=%s, version=%s", Rev, builddate, Version) fmt.Printf("rev=%s, build date=%s, version=%s", Rev, date, Version)
os.Exit(0) os.Exit(0)
} }
verifyInGitRepo() verifyInGitRepo()