forked from jongough/testplugin_pi
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmake-new-plugin.sh
28 lines (21 loc) · 875 Bytes
/
make-new-plugin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/bash
# This script refactors this plugin into a new plugin with a name of your choice.
# To rename the plugin to "catsarebest", run `bash make-new-plugin.sh catsarebest`.
newname="$1"
Newname="$(echo "${newname^}")"
NEWNAME="$(echo "${newname^^}")"
grep -rl testplugin . | grep -v .git | while read name; do
sed -e "s+testplugin+$newname+g" -i "$name";
done
grep -rl Testplugin . | grep -v .git | while read name; do
sed -e "s+Testplugin+$Newname+g" -i "$name";
done
grep -rl TESTPLUGIN . | grep -v .git | while read name; do
sed -e "s+TESTPLUGIN+$NEWNAME+g" -i "$name";
done
find . -name "*testplugin*" | grep -v .git | while read name; do
mv "$name" "$(echo "$name" | sed -e "s+testplugin+$newname+g")"
done
find . -name "*Testplugin*" | grep -v .git | while read name; do
mv "$name" "$(echo "$name" | sed -e "s+Testplugin+$Newname+g")"
done