-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththrow_error.sh
48 lines (38 loc) · 1.04 KB
/
throw_error.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
#!/bin/bash
#Testing the source config
src_test(){
# Run the node test.js script
node test.js source
# Check the exit status of the last executed command
if [ $? -eq 1 ]; then
echo "Error: test.js script failed"
echo "Please check your source config variables in config.js"
exit 1
fi
}
#Testing the target config
target_test(){
# Run the node test.js script
node test.js target
# Check the exit status of the last executed command
if [ $? -eq 1 ]; then
echo "Error: test.js script failed"
echo "Please check your target config variables in config.js"
exit 1
fi
}
throw_errors(){
if [ -z "$SRC_SSH" ] || [ -z "$TARGET_SSH" ] || [ -z "$REPO_DIR" ] || [ -z "$REPO_MIRROR" ]; then
echo "Error: Please set all the required variables in bash_config.sh"
exit 1
fi
if [ -z "$BATCH_SIZE" ]; then
BATCH_SIZE=1
fi
if [ -z "$BRANCH_NUM" ]; then
BRANCH_NUM=0
fi
#Run the node test.js script
echo "$(src_test)"
echo "$(target_test)"
}