Skip to content

Commit

Permalink
fix: correction to exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
rickymoorhouse committed Sep 27, 2022
1 parent 7c6c761 commit 91c236c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion validate-product
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/bin/bash
WHITE='\033[0;33m'
RESET='\033[0m'
RC=0
for filename in $@
do
grep "product:" $filename > /dev/null
if [[ $? == 0 ]];
then
apic --accept-license --live-help validate $filename
echo -e "${WHITE}Validating $filename${RESET}"
tmp=$(mktemp)
apic --accept-license --live-help validate $filename | tee $tmp
grep Error $tmp > /dev/null
if [[ $? == 0 ]];
then
RC=2
fi
fi
done
exit $RC

0 comments on commit 91c236c

Please sign in to comment.