diff --git a/Makefile b/Makefile index 0fde297..db0c21f 100644 --- a/Makefile +++ b/Makefile @@ -74,12 +74,12 @@ release: _ensure-tag _ensure-clean _ensure-current-version @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ if printf "$$new_ver" | grep -q '^[0-9]'; then \ - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ + semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ + semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ else \ - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ + new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ fi; \ - printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ + printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ git commit -m "v$$new_ver" $(VERSIONED_FILES) && \ git tag -a "v$$new_ver" diff --git a/install.sh b/install.sh index 82e5a92..3fd6cab 100755 --- a/install.sh +++ b/install.sh @@ -68,12 +68,12 @@ nvm_download() { elif nvm_has "wget"; then # Emulate curl with wget ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \ - -e 's/-L //' \ - -e 's/--compressed //' \ - -e 's/-I /--server-response /' \ - -e 's/-s /-q /' \ - -e 's/-o /-O /' \ - -e 's/-C - /-c /') + -e 's/-L //' \ + -e 's/--compressed //' \ + -e 's/-I /--server-response /' \ + -e 's/-s /-q /' \ + -e 's/-o /-O /' \ + -e 's/-C - /-c /') # shellcheck disable=SC2086 eval wget $ARGS fi diff --git a/nvm.sh b/nvm.sh index 04315bd..4db2e05 100644 --- a/nvm.sh +++ b/nvm.sh @@ -108,13 +108,13 @@ nvm_download() { elif nvm_has "wget"; then # Emulate curl with wget ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \ - -e 's/--compressed //' \ - -e 's/--fail //' \ - -e 's/-L //' \ - -e 's/-I /--server-response /' \ - -e 's/-s /-q /' \ - -e 's/-o /-O /' \ - -e 's/-C - /-c /') + -e 's/--compressed //' \ + -e 's/--fail //' \ + -e 's/-L //' \ + -e 's/-I /--server-response /' \ + -e 's/-s /-q /' \ + -e 's/-o /-O /' \ + -e 's/-C - /-c /') # shellcheck disable=SC2086 eval wget $ARGS fi @@ -611,8 +611,8 @@ nvm_change_path() { nvm_echo "${3-}${2-}" # if the initial path doesn’t contain an nvm path, prepend the supplementary # path - elif ! echo "${1-}" | nvm_grep -q "${NVM_DIR}/[^/]*${2-}" && \ - ! echo "${1-}" | nvm_grep -q "${NVM_DIR}/versions/[^/]*/[^/]*${2-}"; then + elif ! echo "${1-}" | nvm_grep -q "${NVM_DIR}/[^/]*${2-}" \ + && ! echo "${1-}" | nvm_grep -q "${NVM_DIR}/versions/[^/]*/[^/]*${2-}"; then nvm_echo "${3-}${2-}:${1-}" # use sed to replace the existing nvm path with the supplementary path. This # preserves the order of the path.