12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #!/usr/bin/env bash
- exact_fix() {
-
- images="$(find ./images -type f)"
- IFS=$'\n'
- for image in $images; do
- actual="${image:2}"
- echo "exact_fix: ${actual}"
- rg -il --type-add 'qsrc:*.qsrc' -tqsrc "${actual}" \
- | xargs -I {} sed -i -e "s|${actual}|${actual}|gI" '{}'
- done
- }
- subdir_fix() {
-
-
- images="$(find ./images -type d | sed -e 's|$|/|')"
- IFS=$'\n'
- for image in $images; do
- actual="${image:2}"
- echo "subdir_fix: ${actual}"
- rg -il --type-add 'qsrc:*.qsrc' -tqsrc "${actual}" \
- | xargs -I {} sed -i -e "s|${actual}|${actual}|gI" '{}'
- done
- }
- var_fix() {
-
-
-
-
- images="$(find images -type f | grep -e '[0-9]\.[A-Za-z]*$' | sed -e 's|\(.*/\)\([^0-9]*\).*|\1\2|' -e '/\/$/d' | sort -u)"
- IFS=$'\n'
- for image in $images; do
- actual="${image}'"
- echo "var_fix: ${actual}"
- rg -il --type-add 'qsrc:*.qsrc' -tqsrc "${actual}" \
- | xargs -I {} sed -i -e "s|${actual}|${actual}|gI" '{}'
- actual="${image}<<"
- echo "var_fix: ${actual}"
- rg -il --type-add 'qsrc:*.qsrc' -tqsrc "${actual}" \
- | xargs -I {} sed -i -e "s|${actual}|${actual}|gI" '{}'
- done
- }
- var_fix
- subdir_fix
- exact_fix
- echo "Done!"
|