mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-01 04:10:04 +01:00
nvm.sh uses `NVM_SCRIPT_SOURCE="$_"` to detect its source location. Adding `: nvm.sh` before each source line ensures `$_` is set correctly, preventing breakage when the previous command (e.g., `set -ex`) overwrites it.
22 lines
408 B
Bash
Executable File
22 lines
408 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -ex
|
|
|
|
die () { echo "$@" ; exit 1; }
|
|
|
|
set +e # TODO: fix
|
|
: nvm.sh
|
|
\. ../../../nvm.sh
|
|
set -e
|
|
|
|
BIN="$(nvm_get_checksum_binary)"
|
|
|
|
case "${BIN-}" in
|
|
sha256sum | shasum | sha256 | gsha256sum | openssl | bssl | sha1sum | sha1 | shasum)
|
|
echo "${BIN} found"
|
|
;;
|
|
*)
|
|
die "sha256sum | shasum | sha256 | gsha256sum | openssl | bssl | sha1sum | sha1 | shasum not found: found ${BIN}"
|
|
;;
|
|
esac
|