Last active
July 23, 2024 19:18
-
-
Save dirtycajunrice/16f0131108bd34104821d4fa424d2f2b to your computer and use it in GitHub Desktop.
Template renamer for UnrealEnginePluginTemplate
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
#!/usr/bin/env bash | |
export MODULE_NAME="$(basename $(git rev-parse --show-toplevel))" | |
if [ -z "${MODULE_NAME}" ]; then | |
echo "No module name available" | |
fi | |
# Replace file names | |
find . -name '*MyPlugin*' -printf "%d %p\n" | sort -r | cut -d' ' -f2 | xargs -I{} sh -c 'mv -v {} $(echo {} | sed "s/MyPlugin/$MODULE_NAME/g")' | |
# Replace content | |
grep "MyPlugin" . -lr | xargs sed -i "s/MyPlugin/$MODULE_NAME/g" | |
# Wipe readme | |
echo "# ${MODULE_NAME}" > README.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment