mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	| @@ -69,7 +69,7 @@ install_nvm_from_git() { | ||||
|   if [ -d "$INSTALL_DIR/.git" ]; then | ||||
|     echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git" | ||||
|     printf "\r=> " | ||||
|     cd "$INSTALL_DIR" && (git fetch 2> /dev/null || { | ||||
|     cd "$INSTALL_DIR" && (command git fetch 2> /dev/null || { | ||||
|       echo >&2 "Failed to update nvm, run 'git fetch' in $INSTALL_DIR yourself." && exit 1 | ||||
|     }) | ||||
|   else | ||||
| @@ -77,9 +77,11 @@ install_nvm_from_git() { | ||||
|     echo "=> Downloading nvm from git to '$INSTALL_DIR'" | ||||
|     printf "\r=> " | ||||
|     mkdir -p "$INSTALL_DIR" | ||||
|     git clone "$(nvm_source)" "$INSTALL_DIR" | ||||
|     command git clone "$(nvm_source)" "$INSTALL_DIR" \ | ||||
|       || echo >&2 "Failed to clone nvm repo. Please report this!" && exit 1 | ||||
|     cd "$INSTALL_DIR" | ||||
|   fi | ||||
|   cd "$INSTALL_DIR" && command git checkout --quiet "$(nvm_latest_version)" | ||||
|   command git checkout --quiet "$(nvm_latest_version)" | ||||
|   if [ ! -z "$(cd "$INSTALL_DIR" && git show-ref refs/heads/master)" ]; then | ||||
|     if git branch --quiet 2>/dev/null; then | ||||
|       cd "$INSTALL_DIR" && command git branch --quiet -D master >/dev/null 2>&1 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user