Created
April 4, 2012 04:47
-
-
Save PierrickKoch/2297859 to your computer and use it in GitHub Desktop.
new bge modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| replace() { | |
| old=$1 | |
| new=$2 | |
| files=$(grep "$old" . -lr --exclude="*.pyc" --exclude="*.blend" \ | |
| --exclude="$0" --exclude-dir="build" --exclude-dir=".git") | |
| for f in $files; do | |
| sed -i "s/import $old/import bge/g" $f | |
| sed -i "s/$old/$new/g" $f | |
| done | |
| echo "done" | |
| echo "files still containing $old:" | |
| grep "$old" . -lr --exclude="*.pyc" --exclude-dir="build" \ | |
| --exclude-dir=".git" | |
| } | |
| replace "GameLogic" "bge.logic" | |
| replace "VideoTexture" "bge.texture" | |
| echo "files containing more than one import bge statement:" | |
| grep "import bge" . -crm2 --exclude="*.pyc" --exclude-dir="build" \ | |
| --exclude-dir=".git" | grep :2 | |
| #for f in $tmp; do echo "${f%:2}"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment