pa: build.sh: propogate mka return code
This requires https://gerrit.aospa.co/#/c/3692/ As in the associated commit, this change propogates the return code to the shell environment which called the script. It also prints "Build Failed!" in red as an indication to the user that the build has failed. Change-Id: Ifedffecf4bf87f908056779e5e26e8f997998872 Signed-off-by: Evan Anderson <evananderson@aospa.co>
This commit is contained in:
parent
f90bbe5fb3
commit
dfbf9ac6cc
11
build.sh
11
build.sh
|
@ -152,6 +152,8 @@ fi
|
||||||
echo -e ""
|
echo -e ""
|
||||||
|
|
||||||
# Build away!
|
# Build away!
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
echo -e "${CLR_BLD_BLU}Starting compilation${CLR_RST}"
|
echo -e "${CLR_BLD_BLU}Starting compilation${CLR_RST}"
|
||||||
echo -e ""
|
echo -e ""
|
||||||
if [ "$FLAG_USER_BUILD" = 'y' ]; then
|
if [ "$FLAG_USER_BUILD" = 'y' ]; then
|
||||||
|
@ -159,11 +161,20 @@ if [ "$FLAG_USER_BUILD" = 'y' ]; then
|
||||||
else
|
else
|
||||||
mka bacon
|
mka bacon
|
||||||
fi
|
fi
|
||||||
|
RETVAL=$?
|
||||||
echo -e ""
|
echo -e ""
|
||||||
|
|
||||||
|
# Check if the build failed
|
||||||
|
if [ $RETVAL -ne 0 ]; then
|
||||||
|
echo "${CLR_BLD_RED}Build failed!"
|
||||||
|
echo -e ""
|
||||||
|
fi
|
||||||
|
|
||||||
# Check the finishing time
|
# Check the finishing time
|
||||||
TIME_END=$(date +%s.%N)
|
TIME_END=$(date +%s.%N)
|
||||||
|
|
||||||
# Log those times at the end as a fun fact of the day
|
# Log those times at the end as a fun fact of the day
|
||||||
echo -e "${CLR_BLD_GRN}Total time elapsed:${CLR_RST} ${CLR_GRN}$(echo "($TIME_END - $TIME_START) / 60" | bc) minutes ($(echo "$TIME_END - $TIME_START" | bc) seconds)${CLR_RST}"
|
echo -e "${CLR_BLD_GRN}Total time elapsed:${CLR_RST} ${CLR_GRN}$(echo "($TIME_END - $TIME_START) / 60" | bc) minutes ($(echo "$TIME_END - $TIME_START" | bc) seconds)${CLR_RST}"
|
||||||
echo -e ""
|
echo -e ""
|
||||||
|
|
||||||
|
exit $RETVAL
|
Loading…
Reference in New Issue