From 88444f13c7508063f92bf08361d97e2c9302708b Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 11 Mar 2020 17:21:40 +0100 Subject: [PATCH] Replace makefile with python --- Makefile | 7 ------- publish | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 Makefile create mode 100755 publish diff --git a/Makefile b/Makefile deleted file mode 100644 index d5db3e4..0000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SITES ?= $$(find . -maxdepth 2 -name "Makefile" -not -path "./Makefile" | xargs -I {} dirname {}) - -default: publish - -.PHONY: publish -publish: - for path in $(SITES) ; do echo "Building in $(basename $$path)..." && cd $$path && make publish; done diff --git a/publish b/publish new file mode 100755 index 0000000..859e787 --- /dev/null +++ b/publish @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import os +import os.path +import subprocess + +paths = [p for p in os.listdir('.') if os.path.isdir(p) and 'Makefile' in os.listdir(p)] + +for path in paths: + print("-------------------------------------------------------------------") + print("-------------------------------------------------------------------") + print("-------------------------------------------------------------------") + print("Building in {0}".format(path)) + subprocess.run("cd {} && make html".format(path), shell=True) + print("-------------------------------------------------------------------") + print("-------------------------------------------------------------------") + print("-------------------------------------------------------------------")