File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ if [ ! -z ${match} ]; then
56
56
fi
57
57
58
58
badRequest=" badRequest"
59
+ err=0
59
60
60
61
if [ " $filename " != " na" ]; then
61
62
# single file operation
@@ -70,10 +71,12 @@ if [ "$filename" != "na" ]; then
70
71
echo -e " \nUnexpected response\n"
71
72
exit 1
72
73
fi
73
- responseCount=` echo $result | jq ' del(.requestId) | .[] | length' | awk ' {SUM += $1} END { print SUM }' `
74
- if [ $responseCount -eq 0 2> /dev/null]; then
75
- echo -e " \nEmpty response\n"
76
- exit 1
74
+ if [[ $result == * " [" * ]]; then
75
+ responseCount=` echo $result | jq ' del(.requestId) | .[] | length' | awk ' {SUM += $1} END { print SUM }' `
76
+ if [ $responseCount -eq 0 2> /dev/null]; then
77
+ echo -e " \nEmpty response\n"
78
+ exit 1
79
+ fi
77
80
fi
78
81
else
79
82
# all files with .sh
89
92
# Check for bad request and fail the script if matched
90
93
if [[ ${result} =~ .* $badRequest .* ]]; then
91
94
echo -e " \nUnexpected response\n"
92
- exit 1
95
+ err= 1
93
96
fi
94
- responseCount=` echo $result | jq ' del(.requestId) | .[] | length' | awk ' {SUM += $1} END { print SUM }' `
95
- if [ $responseCount -eq 0 2> /dev/null ]; then
96
- echo -e " \nEmpty response\n"
97
- exit 1
97
+ if [[ $result == * " [" * ]]; then
98
+ responseCount=` echo $result | jq ' del(.requestId) | .[] | length' | awk ' {SUM += $1} END { print SUM }' `
99
+ if [ $responseCount -eq 0 2> /dev/null]; then
100
+ echo -e " \nEmpty response\n"
101
+ err=1
102
+ fi
98
103
fi
99
104
echo -e " \n---------- $file end -------------"
100
105
done
101
106
fi
102
107
103
108
echo $alt_url
109
+ exit $err
You can’t perform that action at this time.
0 commit comments