mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
[Refactor] nvm_install_source
, nvm_install_binary
, nvm_download_artifact
: ensure a version is provided.
This commit is contained in:
parent
51b21bcad1
commit
dc1d3aa943
15
nvm.sh
15
nvm.sh
@ -1516,6 +1516,11 @@ nvm_install_binary() {
|
||||
|
||||
local PREFIXED_VERSION
|
||||
PREFIXED_VERSION="${3-}"
|
||||
if [ -z "${PREFIXED_VERSION}" ]; then
|
||||
nvm_err 'A version number is required.'
|
||||
return 3
|
||||
fi
|
||||
|
||||
local VERSION
|
||||
VERSION="$(nvm_strip_iojs_prefix "${PREFIXED_VERSION}")"
|
||||
|
||||
@ -1631,6 +1636,11 @@ nvm_download_artifact() {
|
||||
local VERSION
|
||||
VERSION="${4}"
|
||||
|
||||
if [ -z "${VERSION}" ]; then
|
||||
nvm_err 'A version number is required.'
|
||||
return 3
|
||||
fi
|
||||
|
||||
if [ "${KIND}" = 'binary' ] && ! nvm_binary_available "${VERSION}"; then
|
||||
nvm_err "No precompiled binary available for ${VERSION}."
|
||||
return
|
||||
@ -1745,6 +1755,11 @@ nvm_install_source() {
|
||||
|
||||
local PREFIXED_VERSION
|
||||
PREFIXED_VERSION="${3-}"
|
||||
if [ -z "${PREFIXED_VERSION}" ]; then
|
||||
nvm_err 'A version number is required.'
|
||||
return 3
|
||||
fi
|
||||
|
||||
local VERSION
|
||||
VERSION="$(nvm_strip_iojs_prefix "${PREFIXED_VERSION}")"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user