-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrename_plugin.sh
68 lines (47 loc) · 1.41 KB
/
rename_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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
# remove the git index
[ -f .git/index ] && rm .git/index || true
rm -rf dist *egg-info || true
find ./ -name '__pycache__' -exec rm -rf {} \; || true
set nounset
set errexit
function replace {
from=$1
to=$2
for d in `find ./ -depth -type d`
do
new=`echo $d | sed "s/$from/$to/g"`
[ "$d" != "$new" ] && mv $d $new
done
for f in `find ./ -type f`
do
new=`echo $f | sed "s/$from/$to/g"`
[ "$f" != "$new" ] && mv $f $new
done
for f in `find ./ -type f -not -name '.git' -not -name 'rename_plugin.sh'`
do
sed -i "s/$from/$to/g" $f
done
}
# RENAME THE PLUGIN
replace "_tutorial" "_data_dms"
replace "tutorial_" "data_dms_"
replace "-tutorial" "-data-dms"
replace "tutorial-" "data-dms-"
replace "_TUTORIAL" "_DATA_DMS"
replace "-TUTORIAL" "-DATA-DMS"
replace "Tutorial" "DataDms"
replace "tutorial" "dataDms"
# RENAME THE STRING INT OBJECT
replace "_string_int" "_thing_one"
replace "string_int_" "thing_one_"
replace "-string-int" "-thing-one"
replace "string-int-" "thing-one-"
replace "STRING_INT" "THING_ONE"
replace "STRING-INT" "THING-ONE"
replace "StringInt" "ThingOne"
replace "stringInt" "thingOne"
replace "String Int" "Thing One"
# Remove compile generated javascript
find ./ -type f -not -name '.git' -name "*.js" -exec rm {} \; || true
find ./ -type f -not -name '.git' -name "*.js.map" -exec rm {} \; || true