mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Add sh directive and replace bash function with sh function.
This commit is contained in:
		
							
								
								
									
										8
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -1,3 +1,5 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
| # Node Version Manager | # Node Version Manager | ||||||
| # Implemented as a bash function | # Implemented as a bash function | ||||||
| # To use source this file from your bash profile | # To use source this file from your bash profile | ||||||
| @@ -16,7 +18,8 @@ if [ ! -z "$(which unsetopt 2>/dev/null)" ]; then | |||||||
|     unsetopt nomatch 2>/dev/null |     unsetopt nomatch 2>/dev/null | ||||||
| fi | fi | ||||||
|  |  | ||||||
| function nvm_set_nullglob { | nvm_set_nullglob() | ||||||
|  | { | ||||||
|   if type setopt > /dev/null 2>&1; then |   if type setopt > /dev/null 2>&1; then | ||||||
|       # Zsh |       # Zsh | ||||||
|       setopt NULL_GLOB |       setopt NULL_GLOB | ||||||
| @@ -27,7 +30,8 @@ function nvm_set_nullglob { | |||||||
| } | } | ||||||
|  |  | ||||||
| # Obtain nvm version from rc file | # Obtain nvm version from rc file | ||||||
| function rc_nvm_version { | rc_nvm_version() | ||||||
|  | { | ||||||
|   if [ -e .nvmrc ]; then |   if [ -e .nvmrc ]; then | ||||||
|         RC_VERSION=`cat .nvmrc | head -n 1` |         RC_VERSION=`cat .nvmrc | head -n 1` | ||||||
|     echo "Found .nvmrc files with version <$RC_VERSION>" |     echo "Found .nvmrc files with version <$RC_VERSION>" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user