mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	updated output without special characters (tab; \t)
Omit duplicate 'finish line' normalized indentation
This commit is contained in:
		| @@ -46,18 +46,18 @@ SOURCE_STR="[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"  # This loads NV | ||||
|  | ||||
| if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then | ||||
|   if [ -z $PROFILE ]; then | ||||
|     echo "=> Profile not found" | ||||
|     echo "=> Profile not found. Tried ~/.bash_profile ~/.zshrc and ~/.profile." | ||||
|     echo "=> Create one of them and run this script again" | ||||
|   else | ||||
|     echo "=> Profile $PROFILE not found" | ||||
|     echo "=> Create it (touch $PROFILE) and run this script again" | ||||
|   fi | ||||
|   echo "=> Append the following line to the correct file yourself" | ||||
|   echo "   OR" | ||||
|   echo "=> Append the following line to the correct file yourself:" | ||||
|   echo | ||||
|   echo "\t$SOURCE_STR" | ||||
|   echo "   $SOURCE_STR" | ||||
|   echo | ||||
|   echo "=> Close and reopen your terminal to start using NVM" | ||||
|   exit | ||||
| fi | ||||
|  | ||||
| else | ||||
|   if ! grep -qc 'nvm.sh' $PROFILE; then | ||||
|     echo "=> Appending source string to $PROFILE" | ||||
|     echo "" >> "$PROFILE" | ||||
| @@ -65,6 +65,7 @@ if ! grep -qc 'nvm.sh' $PROFILE; then | ||||
|   else | ||||
|     echo "=> Source string already in $PROFILE" | ||||
|   fi | ||||
| fi | ||||
|  | ||||
| echo "=> Close and reopen your terminal to start using NVM" | ||||
|  | ||||
|   | ||||
							
								
								
									
										21
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								install.sh
									
									
									
									
									
								
							| @@ -43,24 +43,18 @@ SOURCE_STR="[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"  # This loads NV | ||||
|  | ||||
| if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then | ||||
|   if [ -z $PROFILE ]; then | ||||
| 	echo "=> Profile not found. Tried $HOME/.bash_profile and $HOME/.profile" | ||||
|     echo "=> Profile not found. Tried ~/.bash_profile ~/.zshrc and ~/.profile." | ||||
|     echo "=> Create one of them and run this script again" | ||||
|   else | ||||
|     echo "=> Profile $PROFILE not found" | ||||
|     echo "=> Create it (touch $PROFILE) and run this script again" | ||||
|   fi | ||||
|   echo "=> Run this script again after running the following:" | ||||
|   echo "   OR" | ||||
|   echo "=> Append the following line to the correct file yourself:" | ||||
|   echo | ||||
|   echo "\ttouch $HOME/.profile" | ||||
|   echo "   $SOURCE_STR" | ||||
|   echo | ||||
|   echo "-- OR --" | ||||
|   echo | ||||
|   echo "=> Append the following line to the correct file yourself" | ||||
|   echo | ||||
|   echo "\t$SOURCE_STR" | ||||
|   echo | ||||
|   echo "=> Close and reopen your terminal afterwards to start using NVM" | ||||
|   exit | ||||
| fi | ||||
|  | ||||
| else | ||||
|   if ! grep -qc 'nvm.sh' $PROFILE; then | ||||
|     echo "=> Appending source string to $PROFILE" | ||||
|     echo "" >> "$PROFILE" | ||||
| @@ -68,6 +62,7 @@ if ! grep -qc 'nvm.sh' $PROFILE; then | ||||
|   else | ||||
|     echo "=> Source string already in $PROFILE" | ||||
|   fi | ||||
| fi | ||||
|  | ||||
| echo "=> Close and reopen your terminal to start using NVM" | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user