mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-11-04 05:01:23 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			527 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			527 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
 | 
						|
cleanup () {
 | 
						|
  unset -f die cleanup
 | 
						|
}
 | 
						|
die () { echo "$@" ; cleanup ; exit 1; }
 | 
						|
 | 
						|
NVM_ENV=testing \. ../../install.sh
 | 
						|
 | 
						|
# nvm_download install.sh
 | 
						|
nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" >/dev/null || die "nvm_download unable to download install.sh"
 | 
						|
 | 
						|
# nvm_download should fail to download wrong_install.sh
 | 
						|
if nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/wrong_install.sh" &>/dev/null; then
 | 
						|
  die "nvm_download should fail to download nonexistent file"
 | 
						|
fi
 | 
						|
 | 
						|
cleanup
 |