diff --git a/tools-ng/relocate-theme-dir.sh b/tools-ng/relocate-theme-dir.sh new file mode 100755 index 000000000..685205368 --- /dev/null +++ b/tools-ng/relocate-theme-dir.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Support filenames with spaces +IFS=$'\n' + +function list_dir() { + echo "Set working dir to $(pwd)" + for fh in *; do + if [[ -d "${fh}" ]]; then + pushd "${fh}" + list_dir + popd + else + if [[ -f "${fh}" ]]; then + case "${fh}" in + *.xsl) change_xsl_file "${fh}";; + esac + fi + fi + done +} + +function change_xsl_file() { + filename="$1" + echo "Change file ${filename}" + sed -i "s/__ccm__\///g" "${filename}" + sed -i "s/\.\.\/ROOT/themes\/heirloom/g" "${filename}" + sed -i "s/http\:\/\/ccm\.redhat\.com\/london\/navigation/http\:\/\/ccm.redhat.com\/navigation/g" "${filename}" +# sed -i "s/http\:\/\/ccm\.redhat\.com\/london\/navigation/http\:\/\/ccm.redhat.com\/themedirector/g" "${filename}" +} + +pushd $1 +list_dir +popd