Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / make-flags.sh
blob: 786671d6200a27aebdd784136cf2f1aa02aaab5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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