mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 06:41:50 +00:00
[New] install
: Allow use of --config
This commit is contained in:
parent
db466ab0cb
commit
fb11d3cf69
15
nvm.sh
15
nvm.sh
@ -472,7 +472,13 @@ nvm_find_nvmrc() {
|
|||||||
nvm_rc_version() {
|
nvm_rc_version() {
|
||||||
export NVM_RC_VERSION=''
|
export NVM_RC_VERSION=''
|
||||||
local NVMRC_PATH
|
local NVMRC_PATH
|
||||||
NVMRC_PATH="$(nvm_find_nvmrc)"
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
NVMRC_PATH="$(nvm_find_nvmrc "$1")"
|
||||||
|
else
|
||||||
|
NVMRC_PATH="$(nvm_find_nvmrc)"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e "${NVMRC_PATH}" ]; then
|
if [ ! -e "${NVMRC_PATH}" ]; then
|
||||||
if [ "${NVM_SILENT:-0}" -ne 1 ]; then
|
if [ "${NVM_SILENT:-0}" -ne 1 ]; then
|
||||||
nvm_err "No .nvmrc file found"
|
nvm_err "No .nvmrc file found"
|
||||||
@ -3131,6 +3137,7 @@ nvm() {
|
|||||||
local PROVIDED_REINSTALL_PACKAGES_FROM
|
local PROVIDED_REINSTALL_PACKAGES_FROM
|
||||||
local REINSTALL_PACKAGES_FROM
|
local REINSTALL_PACKAGES_FROM
|
||||||
local SKIP_DEFAULT_PACKAGES
|
local SKIP_DEFAULT_PACKAGES
|
||||||
|
local NVM_RC_PATH
|
||||||
|
|
||||||
while [ $# -ne 0 ]; do
|
while [ $# -ne 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -3225,6 +3232,10 @@ nvm() {
|
|||||||
SKIP_DEFAULT_PACKAGES=true
|
SKIP_DEFAULT_PACKAGES=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--config=*)
|
||||||
|
NVM_RC_PATH="${1#--config=}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
break # stop parsing args
|
break # stop parsing args
|
||||||
;;
|
;;
|
||||||
@ -3246,7 +3257,7 @@ nvm() {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
nvm_rc_version
|
nvm_rc_version "$NVM_RC_PATH"
|
||||||
if [ $version_not_provided -eq 1 ] && [ -z "${NVM_RC_VERSION}" ]; then
|
if [ $version_not_provided -eq 1 ] && [ -z "${NVM_RC_VERSION}" ]; then
|
||||||
unset NVM_RC_VERSION
|
unset NVM_RC_VERSION
|
||||||
>&2 nvm --help
|
>&2 nvm --help
|
||||||
|
Loading…
Reference in New Issue
Block a user