From ef3f8f8e0c03e7f2095ca64e70c1f664c9f2fcf7 Mon Sep 17 00:00:00 2001 From: Szymon Szukalski Date: Mon, 25 Nov 2024 15:07:49 +1100 Subject: Externalise css --- Recipes/process-html.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 Recipes/process-html.sh (limited to 'Recipes/process-html.sh') diff --git a/Recipes/process-html.sh b/Recipes/process-html.sh new file mode 100755 index 0000000..89048f8 --- /dev/null +++ b/Recipes/process-html.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Check if both scripts exist +if [[ ! -x "./remove-styles.sh" ]]; then + echo "Error: remove-styles.sh not found or not executable!" + exit 1 +fi + +if [[ ! -x "./add-css.sh" ]]; then + echo "Error: add-css.sh not found or not executable!" + exit 1 +fi + +# Loop through all .html files in the current directory +for file in *.html; do + # Check if the file exists to handle the case of no matches + if [[ ! -f "$file" ]]; then + echo "No HTML files found in the directory." + exit 0 + fi + + echo "Processing $file..." + + # Call the remove-styles script + ./remove-styles.sh "$file" + + # Call the add-css script + ./add-css.sh "$file" + + echo "$file processed successfully!" +done -- cgit v1.2.3