summaryrefslogtreecommitdiff
path: root/Recipes/process-html.sh
diff options
context:
space:
mode:
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