mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			513 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			513 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| cleanup () {
 | |
|   unset -f die cleanup
 | |
| }
 | |
| die () { echo "$@" ; cleanup ; exit 1; }
 | |
| 
 | |
| \. ../../../nvm.sh
 | |
| 
 | |
| set -ex
 | |
| 
 | |
| # nvm_download install.sh
 | |
| nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh" >/dev/null || die "nvm_download unable to download install.sh"
 | |
| 
 | |
| # nvm_download should fail to download wrong_install.sh
 | |
| ! nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/master/wrong_install.sh" >/dev/null || die "nvm_download should fail to download no existing file"
 | |
| 
 | |
| cleanup
 |