From 2716a8b95ab1b68932bcaa816bae2cf12b56bb17 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 2 Sep 2023 12:39:26 -0400 Subject: make deploy target --- .gitignore | 1 + Makefile | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ce686fd..6eb9d4d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ stack.yaml.lock cosmic-countdown.cabal bin +deploy-target.url diff --git a/Makefile b/Makefile index 0ac7a36..ce87a53 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,21 @@ stack_path != which stack +binout = ./bin/countdown + all: $(if $(stack_path),,install-stack) stack build ln -sfT $$(stack path --local-install-root)/bin ./bin -.PHONY: all run install install-dev-tools - -run: all - ./bin/countdown +.PHONY: all run install install-dev-tools deploy install: stack install +$(binout): install + +run: all + $(binout) + install-dev-tools: stack install apply-refact hlint stylish-haskell hasktags hoogle @@ -32,5 +36,19 @@ endif endif endif +define prompt_user +@bash -c \ + 'read -p $(1) && printf "%s\n" "$${REPLY}" > "$$1"' \ + bash \ + "$@" +endef + +deploy-target.url: + $(call prompt_user, "Enter deploy target rsync URL: ") + +deploy: $(binout) deploy-target.url + @read target < deploy-target.url && set -x && \ + rsync -i4zaP $(binout) "$$target" + %.html: %.md pandoc -f markdown -t html -o $@ $^ -- cgit v1.2.3