diff options
author | David Barri | 2021-03-21 08:40:38 +1100 |
---|---|---|
committer | David Barri | 2021-03-21 08:40:38 +1100 |
commit | c6128f2a3e48bd8877fab761e0433218a46de2ad (patch) | |
tree | 8362519065e8d4be21a4086172c56e7381b65176 | |
parent | 3f272c64f74550a7c6195ccaf97d51e65983efd7 (diff) | |
download | aur-c6128f2a3e48bd8877fab761e0433218a46de2ad.tar.gz |
Add auto-update
-rw-r--r-- | Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,10 +1,11 @@ -.PHONY: post clean upgrade versions +.PHONY: post clean upgrade versions auto-update +CURRENT_VER := $(shell grep '^pkgver' PKGBUILD | sed 's/.*=//') LATEST_VER := $(shell curl -s https://update.tryshift.com/download/version | sed 's/.* version //; s/ .*/\n/') versions: @echo "Current version:" - @grep '^pkgver' PKGBUILD | sed 's/.*=/ /' + @echo " $(CURRENT_VER)" @echo "Latest version:" @echo " $(LATEST_VER)" @@ -22,3 +23,10 @@ post: clean: git clean -fX + +auto-update: +ifeq ($(CURRENT_VER),$(LATEST_VER)) + @echo "No update available. Version: $(CURRENT_VER)" +else + @make upgrade && git push +endif |