commit faaeee793f56685d1df23f75af30c5bbc763b9a2
parent d9c654f42535c986fa93552a93145d25b48e4b65
Author: gracefu <81774659+gracefuu@users.noreply.github.com>
Date: Thu, 10 Apr 2025 05:41:22 +0800
Add git repo itself to website :^)
Diffstat:
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
@@ -55,7 +55,7 @@ TMPPATH=.bunny-tmp
# Set Make stuff
-.PHONY: all upload clean nothing \
+.PHONY: all rebuild upload clean nothing \
$(TMPPATH)/contents/%/contents \
$(TMPPATH)/clean/% $(TMPPATH)/cleanfile/% $(TMPPATH)/cleandir/% \
$(TMPPATH)/upload/%
@@ -84,11 +84,20 @@ all: upload clean
$(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
+ [ -d public/.git ] || git init --bare public/.git
+ git push --mirror --force public/.git
+ git -C public/.git update-server-info
+
upload: $(addprefix $(TMPPATH)/upload/,$(UPLOAD))
clean: $(addprefix $(TMPPATH)/clean/,$(CLEAN))
nothing:
-$(TMPPATH)/contents/%/contents:
+$(TMPPATH)/contents/%/contents: rebuild
# Get dir contents from bunny, and
# Delete any files or directories on bunny that don't exist locally
mkdir -p '$(@D)'
@@ -98,13 +107,13 @@ $(TMPPATH)/contents/%/contents:
$(TMPPATH)/clean/%: $(TMPPATH)/contents/$$(call hash,$$*)/$$*/contents
# echo + clean '$(*)'
- $(MAKE) nothing $$(<'$<' jq -r '"$(TMPPATH)/cleanfile/$(*)/" +
+ $(MAKE) NOREBUILD=1 nothing $$(<'$<' jq -r '"$(TMPPATH)/cleanfile/$(*)/" +
(arrays | .[] | select(.IsDirectory == false).ObjectName)')
- $(MAKE) nothing $$(<'$<' jq -r '"$(TMPPATH)/cleandir/$(*)/" +
+ $(MAKE) NOREBUILD=1 nothing $$(<'$<' jq -r '"$(TMPPATH)/cleandir/$(*)/" +
(arrays | .[] | select(.IsDirectory == true).ObjectName)')
echo - clean '$(*)'
-$(TMPPATH)/cleanfile/%: $(TMPPATH)/contents/$$(call hash,$$(*D))/$$(*D)/contents
+$(TMPPATH)/cleanfile/%:
# echo + cleanfile '$(*)'
if ! [ -f '$(LOCALPATH)/$(*)' ]; then
echo Deleting file '$(*)'
@@ -113,7 +122,7 @@ $(TMPPATH)/cleanfile/%: $(TMPPATH)/contents/$$(call hash,$$(*D))/$$(*D)/contents
fi | tac | tac
# echo - cleanfile '$(*)'
-$(TMPPATH)/cleandir/%: $(TMPPATH)/contents/$$(call hash,$$(*D))/$$(*D)/contents
+$(TMPPATH)/cleandir/%:
# echo + cleandir '$(*)'
if ! [ -d '$(LOCALPATH)/$(*)' ]; then
echo Deleting dir '$(*)'