1
0

Version now is being passed by ld.

This commit is contained in:
Alexander Andreev 2022-08-02 02:54:47 +04:00
parent 0b51ed1cbd
commit a03a874466
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
2 changed files with 4 additions and 2 deletions

View File

@ -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}

View File

@ -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
}