Skip to content


Browse files Browse the repository at this point in the history
clean renaming scripts (#52791)
  • Loading branch information
3nids committed Apr 20, 2023
1 parent f91a2de commit 2f8bb3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 44 deletions.
38 changes: 0 additions & 38 deletions scripts/

This file was deleted.

12 changes: 6 additions & 6 deletions scripts/
Expand Up @@ -2,7 +2,7 @@

# This scripts renames the name of a class as well as its header and cpp file
# (assuming they are the lowercase version of the class name).
# Usage: ./scripts/ src/core QgsMyClassName QgsMyNewClassName

set -e
Expand All @@ -23,12 +23,12 @@ NEW_CLASSUPPER="${NEW_CLASSNAME^^}"

FILES=$(ag -c $OLD_CLASSNAME | cut -d: -f1)

FILES=$(git grep $OLD_CLASSLOWER -- src python | cut -d: -f1)
for f in ${FILES}; do
${GP}sed -i s/${OLD_CLASSNAME}/${NEW_CLASSNAME}/g $f
echo "replacing in $f..."
${GP}sed -i "s/\b${OLD_CLASSNAME}\b/${NEW_CLASSNAME}/g" $f
${GP}sed -i "s/\b${OLD_CLASSUPPER}\b/${NEW_CLASSUPPER}/g" $f
${GP}sed -i "s/\b${OLD_CLASSLOWER}\b/${NEW_CLASSLOWER}/g" $f

set +e
Expand Down

0 comments on commit 2f8bb3c

Please sign in to comment.