From 242cdb02b89102d95f65ebfc6b55b5c1271e1745 Mon Sep 17 00:00:00 2001 From: bryan Date: Wed, 11 Jan 2023 14:31:21 -0500 Subject: [PATCH] Allow cli options to override --- openwrtbuilder | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openwrtbuilder b/openwrtbuilder index 11fd141..451afde 100755 --- a/openwrtbuilder +++ b/openwrtbuilder @@ -7,7 +7,7 @@ # Apache 2.0 License # Set default release -: "${RELEASE:="22.03.2"}" +: "${RELEASE:="22.03.3"}" printHelp() { debug "${FUNCNAME[0]}" @@ -51,7 +51,7 @@ readInput() { while true; do case "$1" in --release|-r|--version|-v) - shift && RELEASE="$1" + shift && declare -g USER_RELEASE="$1" ;; --profile|-p) shift && PROFILES+=("$1") @@ -615,7 +615,7 @@ main() { : "${BUILDDIR:=$SCRIPTDIR}" : "${FILESDIR:=$BUILDDIR/files}" - : "${P_ARR[release]:=$RELEASE}" # profiles overrides user input and hardcoded versions + : "${USER_RELEASE:=P_ARR[release]:=$RELEASE}" # precedence: user input>profiles>env>hardcode : "${P_ARR[source_archive]:=$BUILDDIR/sources/${P_ARR[profile]}-${P_ARR[release]}.tar.xz}" : "${P_ARR[source_dir]:=${P_ARR[source_archive]%.tar.xz}}" : "${P_ARR[out_bin_dir]:=$BUILDDIR/bin/${P_ARR[profile]}-${P_ARR[release]}}"