-
Notifications
You must be signed in to change notification settings - Fork 10
/
tool.sh
37 lines (31 loc) · 1.19 KB
/
tool.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
#!/bin/bash
check_scripts_files_exists(){
local -a arr=(
"eth-account-lock" "deposit-lock" "custodian-lock" "stake-lock"
"tron-account-lock" "withdrawal-lock" "challenge-lock" "omni_lock"
"always-success" "state-validator"
"meta-contract-generator" "sudt-generator" "eth-addr-reg-generator"
"meta-contract-validator" "sudt-validator" "eth-addr-reg-validator"
)
local path=`pwd`/test-result/scripts/godwoken-scripts
check_multiple_files_exists "$path" "${arr[@]}"
}
check_polyjuice_files_exists(){
local -a arr=(
"generator" "generator_log" "validator" "validator_log"
"generator.debug" "generator_log.debug" "validator.debug" "validator_log.debug"
)
local path=`pwd`/test-result/scripts/godwoken-polyjuice
check_multiple_files_exists "$path" "${arr[@]}"
}
check_multiple_files_exists(){
local check_path=$1
local -a arr=("$@")
cd $check_path
for i in "${arr[@]}"
do
if [ "$i" != "$check_path" ]; then # the first one is just the check_path.
[ -f "$i" ] && echo "test pass, found $i." || (echo "test failed, $i not found"; exit 1) ;
fi
done
}