[Refactor] add nvm_get_checksum_binary; use it in nvm debug

This commit is contained in:
Jordan Harband
2020-07-31 22:13:21 -07:00
parent abfe0a5891
commit 424aeb38b4
2 changed files with 57 additions and 23 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -ex
die () { echo "$@" ; exit 1; }
set +e # TODO: fix
\. ../../../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