mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Add wrapping curly braces to ensure that the entire scripts are downloaded.
If the closing curly brace isn't present, the script will error out.
This commit is contained in:
		| @@ -2,6 +2,8 @@ | |||||||
|  |  | ||||||
| set -e | set -e | ||||||
|  |  | ||||||
|  | { # this ensures the entire script is downloaded # | ||||||
|  |  | ||||||
| nvm_has() { | nvm_has() { | ||||||
|   type "$1" > /dev/null 2>&1 |   type "$1" > /dev/null 2>&1 | ||||||
| } | } | ||||||
| @@ -241,3 +243,5 @@ nvm_reset() { | |||||||
| } | } | ||||||
|  |  | ||||||
| [ "_$NVM_ENV" = "_testing" ] || nvm_do_install | [ "_$NVM_ENV" = "_testing" ] || nvm_do_install | ||||||
|  |  | ||||||
|  | } # this ensures the entire script is downloaded # | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -6,6 +6,8 @@ | |||||||
| # Implemented by Tim Caswell <tim@creationix.com> | # Implemented by Tim Caswell <tim@creationix.com> | ||||||
| # with much bash help from Matthew Ranney | # with much bash help from Matthew Ranney | ||||||
|  |  | ||||||
|  | { # this ensures the entire script is downloaded # | ||||||
|  |  | ||||||
| NVM_SCRIPT_SOURCE="$_" | NVM_SCRIPT_SOURCE="$_" | ||||||
|  |  | ||||||
| nvm_has() { | nvm_has() { | ||||||
| @@ -1783,3 +1785,5 @@ elif [ -n "$VERSION" ]; then | |||||||
| elif nvm_rc_version >/dev/null 2>&1; then | elif nvm_rc_version >/dev/null 2>&1; then | ||||||
|   nvm use >/dev/null |   nvm use >/dev/null | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | } # this ensures the entire script is downloaded # | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user