summaryrefslogtreecommitdiff
path: root/Recipes/process-html.sh
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@skas.io>2024-11-25 15:07:49 +1100
committerSzymon Szukalski <szymon@skas.io>2024-11-25 15:07:49 +1100
commitef3f8f8e0c03e7f2095ca64e70c1f664c9f2fcf7 (patch)
tree14e8f75e0eca07675a93a7454af6fb99f0415084 /Recipes/process-html.sh
parent0fb3b92b04e48c8e7f9bb2c005541342a5d7ee0c (diff)
Externalise css
Diffstat (limited to 'Recipes/process-html.sh')
-rwxr-xr-xRecipes/process-html.sh31
1 files changed, 31 insertions, 0 deletions
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