From d3bbe02fcd6497e70f1a8afaafc9ab3e39422cd1 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:40:54 +0800 Subject: [PATCH] Fix input overwritten due to parameter order --- scripts/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 225c5e4..a588686 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -258,7 +258,7 @@ while [[ $# -gt 0 ]]; do --remove-amazon ) REMOVE_AMAZON="remove"; shift ;; --compress ) COMPRESS_OUTPUT="yes"; shift ;; --offline ) OFFLINE="on"; shift ;; - --magisk-custom ) CUSTOM_MAGISK="debug"; MAGISK_VER=$CUSTOM_MAGISK; shift ;; + --magisk-custom ) CUSTOM_MAGISK="debug"; shift ;; --magisk-ver ) MAGISK_VER="$2"; shift 2 ;; --debug ) DEBUG="on"; shift ;; --help ) usage; exit 0 ;; @@ -266,6 +266,12 @@ while [[ $# -gt 0 ]]; do esac done +if [ "$CUSTOM_MAGISK" ]; then + if [ -z "$MAGISK_VER" ]; then + MAGISK_VER=$CUSTOM_MAGISK + fi +fi + check_list() { local input=$1 if [ -n "$input" ]; then