mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Make shasum the lowest priority checksum command.
This fixes false "Checksums do not match" errors on systems where shasum is a symlink to sha256sum or otherwise.
This commit is contained in:
		
							
								
								
									
										6
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -278,12 +278,12 @@ nvm_ls_remote() { | |||||||
| } | } | ||||||
|  |  | ||||||
| nvm_checksum() { | nvm_checksum() { | ||||||
|   if nvm_has "shasum"; then |   if nvm_has "sha1sum"; then | ||||||
|     checksum=$(shasum $1 | \awk '{print $1}') |     checksum=$(sha1sum $1 | \awk '{print $1}') | ||||||
|   elif nvm_has "sha1"; then |   elif nvm_has "sha1"; then | ||||||
|     checksum=$(sha1 -q $1) |     checksum=$(sha1 -q $1) | ||||||
|   else |   else | ||||||
|     checksum=$(sha1sum $1 | \awk '{print $1}') |     checksum=$(shasum $1 | \awk '{print $1}') | ||||||
|   fi |   fi | ||||||
|  |  | ||||||
|   if [ "$checksum" = "$2" ]; then |   if [ "$checksum" = "$2" ]; then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user