* Exit will cause the parent terminal to exit
Test: source cert/set_up_and_run_device_cert.sh --help
Change-Id: I07005a5a3d12f1c01429f7fb70946f2c39a942b9
if [[ "${BASH_SOURCE[0]}" == "${0}" ]] ; then
UsageSourcedNotExecuted
- exit 1
+ return 1
fi
if [[ -z "$ANDROID_BUILD_TOP" ]] ; then
result=0
if [ $LEN -lt 1 ]; then
echo "No devices connected!"
- exit 1
+ return 1
fi
if [ "$LEN" == "" ]; then
echo
echo "Please choose a correct index!" 1>&2
echo
- exit 1
+ return 1
fi
SERIAL=${SERIALS[$answer]}
echo
echo "Needs to be ran in the android tree"
echo
- exit 1
+ return 1
fi
echo "${android_root}"
}
echo " -h | Help(this) Menu"
echo " -d | Dry run; just prints commands"
echo
- exit 0
+ return 0
elif [ "$var" == "-d" ]; then
DRY_RUN="echo"
elif [ "$var" == "-b" ]; then
echo
echo "ERROR: CERT and DUT cannot be the same device, or you only have one device connected!"
echo
- exit 1
+ return 1
fi
## Start builds