mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Find .nvmrc files upwards.
				
					
				
			This commit is contained in:
		
							
								
								
									
										10
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -35,9 +35,13 @@ if [ -z "$NVM_NODEJS_ORG_MIRROR" ]; then | |||||||
| fi | fi | ||||||
|  |  | ||||||
| nvm_find_nvmrc() { | nvm_find_nvmrc() { | ||||||
|   if [ -e '.nvmrc' ]; then |   typeset dir="$PWD" | ||||||
|     echo '.nvmrc' |   typeset found="" | ||||||
|   fi |   while [ "$dir" != "/" ] && [ "$found" = "" ]; do | ||||||
|  |     found=$(find "$dir" -maxdepth 1 -name ".nvmrc") | ||||||
|  |     dir=$(cd "$dir/.." && pwd -P) | ||||||
|  |   done | ||||||
|  |   echo $found | ||||||
| } | } | ||||||
|  |  | ||||||
| # Obtain nvm version from rc file | # Obtain nvm version from rc file | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user