Version now is being passed by ld.
This commit is contained in:
parent
0b51ed1cbd
commit
a03a874466
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
||||
SYSDDIR=${SYSDDIR_:/%=%}
|
||||
DESTDIR=/
|
||||
|
||||
LDFLAGS=-ldflags "-s -w"
|
||||
LDFLAGS=-ldflags "-s -w -X main.version=22.31.0"
|
||||
|
||||
all: ${TARGET}
|
||||
|
||||
|
@ -14,6 +14,8 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var version string
|
||||
|
||||
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
||||
var logToStdout *bool = flag.Bool("log-stdout", false, "write logs to stdout")
|
||||
var showVersion *bool = flag.Bool("v", false, "show version")
|
||||
@ -22,7 +24,7 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
if *showVersion {
|
||||
fmt.Println("dwelling-radio Ver. 22.24.1\nCopyright (c) 2022 Alexander \"Arav\" Andreev <me@arav.top>")
|
||||
fmt.Println("dwelling-radio Ver.", version, "\nCopyright (c) 2022 Alexander \"Arav\" Andreev <me@arav.top>")
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user