mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 14:51:49 +00:00
Fix #476 by making sure to cd into $NVM_DIR
before checking out the tag. Also delete the master branch, because we won't be needing that.
This commit is contained in:
parent
3b42df8d1d
commit
55d892adc8
@ -35,8 +35,8 @@ install_nvm_from_git() {
|
|||||||
if [ -d "$NVM_DIR/.git" ]; then
|
if [ -d "$NVM_DIR/.git" ]; then
|
||||||
echo "=> nvm is already installed in $NVM_DIR, trying to update"
|
echo "=> nvm is already installed in $NVM_DIR, trying to update"
|
||||||
printf "\r=> "
|
printf "\r=> "
|
||||||
cd "$NVM_DIR" && (git pull 2> /dev/null || {
|
cd "$NVM_DIR" && (git fetch 2> /dev/null || {
|
||||||
echo >&2 "Failed to update nvm, run 'git pull' in $NVM_DIR yourself.." && exit 1
|
echo >&2 "Failed to update nvm, run 'git fetch' in $NVM_DIR yourself." && exit 1
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
# Cloning to $NVM_DIR
|
# Cloning to $NVM_DIR
|
||||||
@ -45,7 +45,7 @@ install_nvm_from_git() {
|
|||||||
mkdir -p "$NVM_DIR"
|
mkdir -p "$NVM_DIR"
|
||||||
git clone "$NVM_SOURCE" "$NVM_DIR"
|
git clone "$NVM_SOURCE" "$NVM_DIR"
|
||||||
fi
|
fi
|
||||||
git checkout v0.11.0
|
cd $NVM_DIR && git checkout v0.11.0 && git branch -D master
|
||||||
}
|
}
|
||||||
|
|
||||||
install_nvm_as_script() {
|
install_nvm_as_script() {
|
||||||
|
Loading…
Reference in New Issue
Block a user