diff --git a/script/build.config.sh b/script/build.config.sh index 98ff9f3..2a0ceb4 100644 --- a/script/build.config.sh +++ b/script/build.config.sh @@ -13,10 +13,11 @@ function parseDepArgs() { web_version="${i#*=}" shift ;; + *) + return 1 + ;; esac done - - echo "$@" } function printDepHelp() { diff --git a/script/build.sh b/script/build.sh index ea98f21..b3ae944 100755 --- a/script/build.sh +++ b/script/build.sh @@ -764,13 +764,6 @@ function loadBuildConfig() { fi } -function checkArgs() { - if [[ $# -gt 0 ]]; then - echo -e "${COLOR_RED}Invalid option: $*${COLOR_RESET}" - exit 1 - fi -} - loadBuildConfig initHostPlatforms @@ -837,14 +830,17 @@ for i in "$@"; do host_cxx="${i#*=}" shift ;; + *) + if declare -f parseDepArgs >/dev/null && parseDepArgs "$i"; then + shift + continue + fi + echo -e "${COLOR_RED}Invalid option: $i${COLOR_RESET}" + exit 1 + ;; esac done -if declare -f parseDepArgs >/dev/null; then - set -- $(parseDepArgs "$@") -fi - -checkArgs "$@" fixArgs initPlatforms autoBuild "${platforms}"