Only update version if version.txt does not exist

This commit is contained in:
Elara 2022-05-01 21:21:22 -07:00
parent 68d8588978
commit f532a05c66

View File

@ -3,7 +3,7 @@ BIN_PREFIX = $(DESTDIR)$(PREFIX)/bin
SERVICE_PREFIX = $(DESTDIR)$(PREFIX)/lib/systemd/user SERVICE_PREFIX = $(DESTDIR)$(PREFIX)/lib/systemd/user
CFG_PREFIX = $(DESTDIR)/etc CFG_PREFIX = $(DESTDIR)/etc
all: version all: version.txt
go build $(GOFLAGS) go build $(GOFLAGS)
go build ./cmd/itctl $(GOFLAGS) go build ./cmd/itctl $(GOFLAGS)
@ -24,7 +24,7 @@ uninstall:
rm $(SERVICE_PREFIX)/itd.service rm $(SERVICE_PREFIX)/itd.service
rm $(CFG_PREFIX)/itd.toml rm $(CFG_PREFIX)/itd.toml
version: version.txt:
printf "r%s.%s" "$(shell git rev-list --count HEAD)" "$(shell git rev-parse --short HEAD)" > version.txt printf "r%s.%s" "$(shell git rev-list --count HEAD)" "$(shell git rev-parse --short HEAD)" > version.txt
.PHONY: all clean install uninstall version .PHONY: all clean install uninstall