add rename script

This commit is contained in:
Ray Elliott 2020-05-08 13:05:21 +00:00
parent b9153665cc
commit 26e7c3ec1f
1 changed files with 17 additions and 0 deletions

17
rename-theme.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ -z "$1" ] ; then
_name=${PWD##*/}
if [ -z "$_name" ] ; then
echo "Error - could not determine theme name"
echo "Please rerun and pass theme name as an argument."
exit 1
fi
else
_name="$1"
fi
# search and replace
find . -type f -name "**/*.php" -print0 | xargs -0 sed -i '' -e 's/understrap/'"$_name"'_/g'