Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4c31463 authored by Jack He's avatar Jack He
Browse files

User "return" instead of "exit" in shell scripts

* Exit will cause the parent terminal to exit

Test: source cert/set_up_and_run_device_cert.sh --help
Change-Id: I07005a5a3d12f1c01429f7fb70946f2c39a942b9
parent caf06134
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ function CompileBluetoothPacketsPython3 {

if [[ "${BASH_SOURCE[0]}" == "${0}" ]] ; then
    UsageSourcedNotExecuted
    exit 1
    return 1
fi

if [[ -z "$ANDROID_BUILD_TOP" ]] ; then
+5 −5
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ function menu-adb() {
    result=0
    if [ $LEN -lt 1 ]; then
        echo "No devices connected!"
        exit 1
        return 1
    fi

    if [ "$LEN" == "" ]; then
@@ -47,7 +47,7 @@ function menu-adb() {
        echo
        echo "Please choose a correct index!" 1>&2
        echo
        exit 1
        return 1
    fi

    SERIAL=${SERIALS[$answer]}
@@ -72,7 +72,7 @@ function get-android-root() {
        echo
        echo "Needs to be ran in the android tree"
        echo
        exit 1
        return 1
    fi
    echo "${android_root}"
}
@@ -100,7 +100,7 @@ if [ $# -gt 0 ]; then
            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
@@ -122,7 +122,7 @@ if [ "${CERT_SERIAL}" == "${DUT_SERIAL}" ]; 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