-
Notifications
You must be signed in to change notification settings - Fork 35
/
APITEST
43 lines (38 loc) · 897 Bytes
/
APITEST
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
#!/bin/bash
# 获取当前shell文件的路径
SOURCE="$0"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
FILENAME=(
"balance_bonus.js"
"balance_transfers.js"
"balance_transactions.js"
"withdrawal.js"
"batch_withdrawals.js"
"user.js"
"coupon.js"
"coupon_template.js"
"order.js"
"order_refunds.js"
"recharge.js"
"recharge_refunds.js"
"royalty_template.js"
)
cd "$DIR/example"
function read_dir() {
for file in `ls $1`
do
if [ -d $1"/"$file ]
then
read_dir $1"/"$file
elif [ "${file##*.}"x = "js"x ] && [[ "${FILENAME[@]}" =~ $file ]]
then
node $1"/"$file
fi
done
}
read_dir "$DIR/example"