mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	| @@ -30,14 +30,14 @@ install_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" | ||||||
|     echo -e "\r=> \c" |     printf "\r=> " | ||||||
|     cd "$NVM_DIR" && git pull 2> /dev/null || { |     cd "$NVM_DIR" && git pull 2> /dev/null || { | ||||||
|       echo >&2 "Failed to update nvm, run 'git pull' in $NVM_DIR yourself.." |       echo >&2 "Failed to update nvm, run 'git pull' in $NVM_DIR yourself.." | ||||||
|     } |     } | ||||||
|   else |   else | ||||||
|     # Cloning to $NVM_DIR |     # Cloning to $NVM_DIR | ||||||
|     echo "=> Downloading nvm from git to '$NVM_DIR'" |     echo "=> Downloading nvm from git to '$NVM_DIR'" | ||||||
|     echo -e "\r=> \c" |     printf "\r=> " | ||||||
|     mkdir -p "$NVM_DIR" |     mkdir -p "$NVM_DIR" | ||||||
|     git clone "$NVM_SOURCE" "$NVM_DIR" |     git clone "$NVM_SOURCE" "$NVM_DIR" | ||||||
|   fi |   fi | ||||||
| @@ -113,12 +113,12 @@ if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then | |||||||
|   fi |   fi | ||||||
|   echo "   OR" |   echo "   OR" | ||||||
|   echo "=> Append the following lines to the correct file yourself:" |   echo "=> Append the following lines to the correct file yourself:" | ||||||
|   echo -e "$SOURCE_STR" |   printf "$SOURCE_STR" | ||||||
|   echo |   echo | ||||||
| else | else | ||||||
|   if ! grep -qc 'nvm.sh' $PROFILE; then |   if ! grep -qc 'nvm.sh' $PROFILE; then | ||||||
|     echo "=> Appending source string to $PROFILE" |     echo "=> Appending source string to $PROFILE" | ||||||
|     echo -e "$SOURCE_STR" >> "$PROFILE" |     printf "$SOURCE_STR" >> "$PROFILE" | ||||||
|   else |   else | ||||||
|     echo "=> Source string already in $PROFILE" |     echo "=> Source string already in $PROFILE" | ||||||
|   fi |   fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user