mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	handle echo implementations that do not support -e
				
					
				
			This commit is contained in:
		
							
								
								
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -26,6 +26,9 @@ if [ ! -d "$NVM_DIR" ]; then | |||||||
|   fi |   fi | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | DASH_E="" | ||||||
|  | [ -z "$(echo -n -e)" ] && DASH_E="-e" | ||||||
|  |  | ||||||
| # Setup mirror location if not already set | # Setup mirror location if not already set | ||||||
| if [ -z "$NVM_NODEJS_ORG_MIRROR" ]; then | if [ -z "$NVM_NODEJS_ORG_MIRROR" ]; then | ||||||
|   export NVM_NODEJS_ORG_MIRROR="http://nodejs.org/dist" |   export NVM_NODEJS_ORG_MIRROR="http://nodejs.org/dist" | ||||||
| @@ -139,7 +142,7 @@ nvm_checksum() { | |||||||
| } | } | ||||||
|  |  | ||||||
| colorize_version() { | colorize_version() { | ||||||
|   echo -e "\033[0;34m$1\033[0m" |   echo $DASH_E "\033[0;34m$1\033[0m" | ||||||
| } | } | ||||||
|  |  | ||||||
| print_versions() { | print_versions() { | ||||||
| @@ -482,7 +485,7 @@ nvm() { | |||||||
|         return |         return | ||||||
|     ;; |     ;; | ||||||
|     "current" ) |     "current" ) | ||||||
|       echo -ne "current: \t"; nvm_version current |       echo $DASH_E -n "current: \t"; nvm_version current | ||||||
|     ;; |     ;; | ||||||
|     "alias" ) |     "alias" ) | ||||||
|       mkdir -p $NVM_DIR/alias |       mkdir -p $NVM_DIR/alias | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user