Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Dungeons of Dredmor case insensitive file referencing fix
- if [ ! -f game/monDB.xml ]
- then
- echo Didn\'t find \"game/monDB.xml\". Run script from same directory as Dredmor-amd64 and Dredmor-x86
- exit 1
- fi
- ERROR=0
- for FILE in `grep sprites game/monDB.xml | awk -F\" '{print $2}'`
- do
- # file referenced in xml, lets try to do something about that
- if [ ! -f $FILE ]
- then
- ACTUAL=$(find . -iwholename ./$FILE)
- ACTUAL=${ACTUAL:2}
- #if found correct case of existing file then fix xml file with that info
- if [ -n "$ACTUAL" ]
- then
- echo $FILE -\> $ACTUAL
- sed -i "s|$FILE|$ACTUAL|g" game/monDB.xml
- else
- echo WARNING $FILE referenced by monDB.xml doesnt exist
- fi
- ERROR=1
- fi
- done
- if [ $ERROR -eq 0 ]
- then
- echo Congratulations your monDB.xml seems to be case aware
- else
- echo
- echo Changed monDB.xml entries on the left to their real names on the right
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement