Fix: parse dep args

pull/194/head v0.6.5
zijiren233 9 months ago
parent 31a9e69f56
commit ea49f7ab3b

@ -2,7 +2,7 @@ function parseDepArgs() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "${1}" in case "${1}" in
--version=*) --version=*)
VERSION="${i#*=}" VERSION="${1#*=}"
shift shift
;; ;;
--skip-init-web) --skip-init-web)
@ -10,11 +10,11 @@ function parseDepArgs() {
shift shift
;; ;;
--web-version=*) --web-version=*)
WEB_VERSION="${i#*=}" WEB_VERSION="${1#*=}"
shift shift
;; ;;
--web-repo=*) --web-repo=*)
WEB_REPO="${i#*=}" WEB_REPO="${1#*=}"
shift shift
;; ;;
*) *)
@ -48,8 +48,8 @@ function initDepPlatforms() {
function initDep() { function initDep() {
setDefault "VERSION" "dev" setDefault "VERSION" "dev"
VERSION="$(echo "$VERSION" | sed 's/ //g' | sed 's/"//g' | sed 's/\n//g')" 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 if [[ "${VERSION}" != "dev" ]] && [[ ! "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-beta.*|-rc.*|-alpha.*)?$ ]]; then
echo "version format error: ${VERSION}" echo -e "${COLOR_LIGHT_RED}Version format error: ${VERSION}${COLOR_RESET}"
return 1 return 1
fi fi
setDefault "WEB_VERSION" "${VERSION}" setDefault "WEB_VERSION" "${VERSION}"

@ -848,7 +848,7 @@ function loadedBuildConfig() {
# Loads the build configuration file if it exists. # Loads the build configuration file if it exists.
function loadBuildConfig() { function loadBuildConfig() {
if [[ -f "${BUILD_CONFIG:=$DEFAULT_BUILD_CONFIG}" ]]; then if [[ -f "${BUILD_CONFIG:=$DEFAULT_BUILD_CONFIG}" ]]; then
source "$BUILD_CONFIG" source $BUILD_CONFIG
load_build_config="true" load_build_config="true"
fi fi
} }

Loading…
Cancel
Save