From 26e7c3ec1f72632fb18837ea2cfec567f57eeddd Mon Sep 17 00:00:00 2001 From: rayelliott Date: Fri, 8 May 2020 13:05:21 +0000 Subject: [PATCH] add rename script --- rename-theme.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 rename-theme.sh diff --git a/rename-theme.sh b/rename-theme.sh new file mode 100755 index 0000000..05db2b1 --- /dev/null +++ b/rename-theme.sh @@ -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'