-
Notifications
You must be signed in to change notification settings - Fork 1
/
transfer_path.sh
30 lines (26 loc) · 691 Bytes
/
transfer_path.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
# change import path
# sofastack.io/sofa-mosn to mosn.io/mosn
REPSTR="s/sofastack.io\/sofa-mosn/mosn.io\/mosn/g"
GREPSTR="grep sofastack.io/sofa-mosn -rl"
CODES=("./pkg/" "./examples/codes/" "./test/" "./cmd/")
# valid for MacOS (Drawin)
# if you run the script in MacOS, you should use this one
#SED_CMD="sed -i ''"
# valid for Linux
# if you run the script in Linux, you should use this one
#SED_CMD="sed -i"
# auto detect system
SYSTEM=`uname -s`
# valid for Linux
OS="Linux"
SED_CMD="sed -i"
# valid for MacOS (Drawin)
if [ $SYSTEM = "Darwin" ] ; then
OS="Darwin"
SED_CMD="sed -i ''"
fi
for CODE in "${CODES[@]}"
do
CMD="$SED_CMD \"$REPSTR\" \`$GREPSTR $CODE\`"
eval "$CMD"
done