From 72d297aef47f42c0f7e2f25d86d5ec4de4390f95 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Tue, 23 Jun 2020 03:00:29 -0400 Subject: makefile now safely installs over older versions checks for existence of getwtxt.yml, style.css, and index.html. these files won't be overwritten, but the user is notified to merge them manually. --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index db5f2bf..9cf7895 100644 --- a/Makefile +++ b/Makefile @@ -34,9 +34,9 @@ install: @printf "\n%s\n" "Copying files..." install -m755 getwtxt $(BINDIR) - install -m644 getwtxt.yml $(BINDIR) - install -m644 assets/style.css $(BINDIR)/assets - install -m644 assets/tmpl/index.html $(BINDIR)/assets/tmpl + @if [ -f "$(BINDIR)/getwtxt.yml" ]; then printf "%s\n" "getwtxt.yml exists. Skipping ..."; else printf "%s\n" "getwtxt.yml ..." && install -m644 getwtxt.yml "$(BINDIR)"; fi + @if [ -f "$(BINDIR)/assets/style.css" ]; then printf "%s\n" "style.css exists. Skipping ..."; else printf "%s\n" "style.css ..." && install -m644 assets/style.css "$(BINDIR)/assets/style.css"; fi + @if [ -f "$(BINDIR)/assets/tmpl/index.html" ]; then printf "%s\n" "tmpl/index.html exists. Skipping ..."; else printf "%s\n" "tmpl/index.html ..." && install -m644 assets/tmpl/index.html "$(BINDIR)/assets/tmpl/index.html"; fi install -m644 static/kognise.water.css.dark.min.css $(BINDIR)/static install -m644 README.md $(BINDIR)/docs install -m644 LICENSE $(BINDIR)/docs @@ -45,7 +45,9 @@ install: @printf "\n%s\n" "Setting ownership..." chown -R getwtxt:getwtxt $(BINDIR) - @printf "\n%s\n\t%s\n" "...Done! Don't forget to run:" "systemctl enable getwtxt" + @printf "\n%s\n" "If any files were skipped and there were changes upstream, you may need to merge them manually." + + @printf "\n%s\n\t%s\n\n" "...Done! Don't forget to run:" "systemctl enable getwtxt" .PHONY: uninstall uninstall: -- cgit 1.4.1-2-gfad0