Skip to content

Commit ffaa8c1

Browse files
fdgonthierdanielleadams
authored andcommitted
build: do not "exit" a script meant to be "source"d
Running exit in a script meant to be sourced means the user shell will exit, which prevents seeing the error message, and is generally very annoying. Fix the "android-configure" script to use "return" instead of "exit". PR-URL: #35520 Fixes: #35519 Reviewed-By: Michaël Zasso <[email protected]>
1 parent 9156f43 commit ffaa8c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android-configure

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
if [ $# -ne 3 ]; then
1212
echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
13-
exit 1
13+
return 1
1414
fi
1515

1616
NDK_PATH=$1
@@ -44,7 +44,7 @@ case $ARCH in
4444
;;
4545
*)
4646
echo "Unsupported architecture provided: $ARCH"
47-
exit 1
47+
return 1
4848
;;
4949
esac
5050

@@ -58,7 +58,7 @@ major=$(echo $host_gcc_version | awk -F . '{print $1}')
5858
minor=$(echo $host_gcc_version | awk -F . '{print $2}')
5959
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || [ $major -eq 6 -a $minor -lt 3 ]; then
6060
echo "host gcc $host_gcc_version is too old, need gcc 6.3.0"
61-
exit 1
61+
return 1
6262
fi
6363

6464
SUFFIX="$TOOLCHAIN_NAME$ANDROID_SDK_VERSION"

0 commit comments

Comments
 (0)