commit e2fe77857cc6bf5d04546c99e4b53195d68b240d
parent c459dd4d07fe22f1820a63a06250c6ee8389bc96
Author: gracefu <81774659+gracefuu@users.noreply.github.com>
Date: Thu, 10 Apr 2025 19:23:48 +0800
Reorganise Makefile a little
Diffstat:
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
@@ -55,7 +55,7 @@ TMPPATH=.bunny-tmp
# Set Make stuff
-.PHONY: all rebuild upload clean nothing \
+.PHONY: all sync purge rebuild upload clean nothing \
$(TMPPATH)/contents/%/contents \
$(TMPPATH)/clean/% $(TMPPATH)/cleanfile/% $(TMPPATH)/cleandir/% \
$(TMPPATH)/upload/%
@@ -78,16 +78,19 @@ STORAGECMD=curl -H 'AccessKey: $(STORAGEPASSWORD)' -s
PURGEURL='https://api.bunny.net/pullzone/$(PULLZONEID)/purgeCache'
APICMD=curl -H 'AccessKey: $(APIPASSWORD)' -s
-all:
- $(MAKE) rebuild
- $(MAKE) upload clean
+all: rebuild
+ $(MAKE) sync
+
+sync: upload clean
+ $(MAKE) purge
+
+purge:
rm -rf $(TMPPATH)
if [ -n '$(PULLZONEID)' ]; then
$(APICMD) -XPOST '$(PURGEURL)' && echo 'Purged.'
fi
rebuild:
- @
if [ -n '$(NOREBUILD)' ]; then exit; fi
find public -mindepth 1 -maxdepth 1 -path 'public/.git' -prune -o -exec rm -r {} +
zine release