Script zum umstellen von alten Themes auf die neue Verzeichnisstruktur

git-svn-id: https://svn.libreccm.org/ccm/trunk@2426 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2013-11-07 12:12:35 +00:00
parent 075bd1c6d7
commit 51a8d73150
1 changed files with 34 additions and 0 deletions

View File

@ -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