From ea49f7ab3b62a049f65f077f041682d0b63ac8f0 Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Mon, 17 Jun 2024 02:39:39 +0800 Subject: [PATCH] Fix: parse dep args --- script/build.config.sh | 10 +++++----- script/build.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/build.config.sh b/script/build.config.sh index 7261306..8f1cef4 100644 --- a/script/build.config.sh +++ b/script/build.config.sh @@ -2,7 +2,7 @@ function parseDepArgs() { while [[ $# -gt 0 ]]; do case "${1}" in --version=*) - VERSION="${i#*=}" + VERSION="${1#*=}" shift ;; --skip-init-web) @@ -10,11 +10,11 @@ function parseDepArgs() { shift ;; --web-version=*) - WEB_VERSION="${i#*=}" + WEB_VERSION="${1#*=}" shift ;; --web-repo=*) - WEB_REPO="${i#*=}" + WEB_REPO="${1#*=}" shift ;; *) @@ -48,8 +48,8 @@ function initDepPlatforms() { function initDep() { setDefault "VERSION" "dev" VERSION="$(echo "$VERSION" | sed 's/ //g' | sed 's/"//g' | sed 's/\n//g')" - if [[ "${VERSION}" != "dev" ]] && [[ ! "${VERSION}" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-beta.*|-rc.*|-alpha.*)?$ ]]; then - echo "version format error: ${VERSION}" + if [[ "${VERSION}" != "dev" ]] && [[ ! "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-beta.*|-rc.*|-alpha.*)?$ ]]; then + echo -e "${COLOR_LIGHT_RED}Version format error: ${VERSION}${COLOR_RESET}" return 1 fi setDefault "WEB_VERSION" "${VERSION}" diff --git a/script/build.sh b/script/build.sh index b1a45dd..08240c8 100755 --- a/script/build.sh +++ b/script/build.sh @@ -848,7 +848,7 @@ function loadedBuildConfig() { # Loads the build configuration file if it exists. function loadBuildConfig() { if [[ -f "${BUILD_CONFIG:=$DEFAULT_BUILD_CONFIG}" ]]; then - source "$BUILD_CONFIG" + source $BUILD_CONFIG load_build_config="true" fi }