diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-05-30T12·15+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30T12·15+0200 |
commit | d8abee9bc6dd12173857e27c08a6ed116c2343f4 (patch) | |
tree | 9df141e570b1e6b7c6b2876923fdf3251aa6cacb | |
parent | 17ef3e6f411b2cf1fa87593ad84bc2a94a1edd93 (diff) | |
parent | a8251ba2ed9e833ef3e8b20d233064aba74446db (diff) |
Merge pull request #2892 from johannes-climacus/master
Replace `type` with `command -v` in install script
-rw-r--r-- | scripts/install.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/install.in b/scripts/install.in index 7bff7b216d9e..4857638c0265 100644 --- a/scripts/install.in +++ b/scripts/install.in @@ -18,7 +18,7 @@ cleanup() { trap cleanup EXIT INT QUIT TERM require_util() { - type "$1" > /dev/null 2>&1 || command -v "$1" > /dev/null 2>&1 || + command -v "$1" > /dev/null 2>&1 || oops "you do not have '$1' installed, which I need to $2" } @@ -41,11 +41,11 @@ require_util tar "unpack the binary tarball" echo "downloading Nix @nixVersion@ binary tarball for $system from '$url' to '$tmpDir'..." curl -L "$url" -o "$tarball" || oops "failed to download '$url'" -if type sha256sum > /dev/null 2>&1; then +if command -v sha256sum > /dev/null 2>&1; then hash2="$(sha256sum -b "$tarball" | cut -c1-64)" -elif type shasum > /dev/null 2>&1; then +elif command -v shasum > /dev/null 2>&1; then hash2="$(shasum -a 256 -b "$tarball" | cut -c1-64)" -elif type openssl > /dev/null 2>&1; then +elif command -v openssl > /dev/null 2>&1; then hash2="$(openssl dgst -r -sha256 "$tarball" | cut -c1-64)" else oops "cannot verify the SHA-256 hash of '$url'; you need one of 'shasum', 'sha256sum', or 'openssl'" |