1
0

Now version is being set from a Makefile.

This commit is contained in:
Alexander Andreev 2022-08-02 01:12:47 +04:00
parent f15cf88ad9
commit 3aa9186f9e
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
2 changed files with 4 additions and 3 deletions

View File

@ -1,11 +1,10 @@
TARGET=dwelling-files
SYSCTL=${shell which systemctl}
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
SYSDDIR=${SYSDDIR_:/%=%}
DESTDIR=/
LDFLAGS=-ldflags "-s -w" -tags osusergo,netgo
LDFLAGS=-ldflags "-s -w -X main.version=22.31.0" -tags osusergo,netgo
all: ${TARGET}

View File

@ -14,6 +14,8 @@ import (
"syscall"
)
var version string
var listenAddress *string = flag.String("listen", "/var/run/dwelling-files/f.sock", "listen address (ip:port|unix_path)")
var directoryPath *string = flag.String("path", "/srv/ftp", "path to file share")
var disableFileHandler *bool = flag.Bool("no-file-handling", false, "disable file handling if it is handled by something else (e.g. NGiNX)")
@ -24,7 +26,7 @@ func main() {
log.SetFlags(0)
if *showVersion {
fmt.Println("dwelling-files ver. 22.27.0\nCopyright (c) 2022 Alexander \"Arav\" Andreev <me@arav.top>")
fmt.Println("dwelling-files ver.", version, "\nCopyright (c) 2022 Alexander \"Arav\" Andreev <me@arav.top>")
return
}