mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-13 15:41:51 +00:00
Introduce "copy" METHOD for installation
This method copies the folder containing install.sh (normally also containing the repo) to $NVM_DIR - unless of course the install.sh being executed is in $NVM_DIR (where nvm was installed) This is useful for vagrant to test local changes instead of pulling them from git and thus testing what's on the server and not local changes
This commit is contained in:
parent
50169c11eb
commit
6acce5246a
12
install.sh
12
install.sh
@ -109,6 +109,18 @@ nvm_do_install() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
install_nvm_as_script
|
install_nvm_as_script
|
||||||
|
elif [ "~$METHOD" = "~copy" ]; then
|
||||||
|
local COPY=true
|
||||||
|
if [ $DIR = $NVM_DIR ]; then
|
||||||
|
echo "=> install.sh is already in $NVM_DIR"
|
||||||
|
COPY=false
|
||||||
|
elif [ -d $NVM_DIR ]; then
|
||||||
|
echo "=> $NVM_DIR already exists and its contents will be replaced"
|
||||||
|
fi
|
||||||
|
mkdir -p $NVM_DIR
|
||||||
|
if $COPY; then
|
||||||
|
cp -R $DIR/* $NVM_DIR
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user