noxz-sites

A collection of a builder and various scripts creating the noxz.tech sites
git clone https://noxz.tech/git/noxz-sites.git
Log | Files | README | LICENSE

commit: 01f541cb569e28b51dd75c8ceade10c97a44b40e
parent: 8d70d223148bea4b211ffcc5e1f3df81611251f1
author: Chris Noxz <chris@noxz.tech>
date:   Sun, 1 Aug 2021 21:42:10 +0200
add build check into Makefile
MMakefile5++++-
Mbuild5+++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -1,6 +1,6 @@
 include config.mk
 
-all: clean
+all: clean check
 	@echo building sites
 	@./build
 	@
@@ -11,6 +11,9 @@ all: clean
 	@echo assembling tar archive '${ASSEMBLE_TAR}'
 	@./assemble ${ASSEMBLE_TAR}
 
+check:
+	@./build check
+
 publish:
 	@echo publishing to web server...
 	@[ -f ${ASSEMBLE_TAR} ] && scp ${ASSEMBLE_TAR} ${PUBLISH_PATH} || echo must build first
diff --git a/build b/build
@@ -678,6 +678,11 @@ generate_sitemap() {
 }
 
 main() {
+	# check if build is possible
+	if [ "$1" = "check" ]; then
+		[ -d "${SITE_GIT_REPO_ROOT}" ] || exit 50
+	fi
+
 	# make sure both arguments, if existing, are directories
 	[ ! -z "$1" ] && [ ! -d "$1" ] && return
 	[ ! -z "$2" ] && [ ! -d "$2" ] && return