Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / make-flags.sh
diff options
context:
space:
mode:
1 files changed, 17 insertions, 0 deletions
-rwxr-xr-xgenerate-hooks/make-flags.sh17
diff --git a/generate-hooks/make-flags.sh b/generate-hooks/make-flags.sh
new file mode 100755
index 0000000..786671d
--- /dev/null
+++ b/generate-hooks/make-flags.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Adds a way to more simply insert flags into text
+# Each flag is represented with an ftag (text that is preceded by &&)
+
+# Available flags:
+# Great Britain - &&gb
+
+if [ -z "$1" ]; then
+ echo First parameter must be a path
+ exit
+fi
+
+for file in $(find "$1" -type f -name "*.html"); do
+ # Replaces "&&gb" with "<img src="/img/gb.svg" class="unzoomable" alt="ENG" title="ENG">"
+ sed -i 's/&#38;&#38;gb/<img src="\/img\/gb.svg" class="unzoomable" alt="ENG" title="ENG">/g' "$file"
+done