mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	nvm_strip_path: Error out when $NVM_DIR is not set.
				
					
				
			Per https://github.com/creationix/nvm/issues/1083#issuecomment-217752185
This commit is contained in:
		
							
								
								
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -403,6 +403,10 @@ nvm_num_version_groups() { | |||||||
| } | } | ||||||
|  |  | ||||||
| nvm_strip_path() { | nvm_strip_path() { | ||||||
|  |   if [ -z "${NVM_DIR-}" ]; then | ||||||
|  |     nvm_err '$NVM_DIR not set!' | ||||||
|  |     return 1 | ||||||
|  |   fi | ||||||
|   nvm_echo "$1" | command sed \ |   nvm_echo "$1" | command sed \ | ||||||
|     -e "s#$NVM_DIR/[^/]*$2[^:]*:##g" \ |     -e "s#$NVM_DIR/[^/]*$2[^:]*:##g" \ | ||||||
|     -e "s#:$NVM_DIR/[^/]*$2[^:]*##g" \ |     -e "s#:$NVM_DIR/[^/]*$2[^:]*##g" \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user