]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
_autoenv_hash_pair: use sha1sum for v1 hashes
authorDaniel Hahler <git@thequod.de>
Fri, 15 Dec 2017 22:41:44 +0000 (23:41 +0100)
committerDaniel Hahler <github@thequod.de>
Sat, 16 Dec 2017 00:03:54 +0000 (01:03 +0100)
shasum was replaced by sha1sum before, and appears to have been added
back accidentally in dfb5648.

autoenv.zsh

index 538e92fcb1db2c30f469f734729ac654934e9216..2dbafe517a85da8475afaa876ea5510b5cef7270 100644 (file)
@@ -178,11 +178,11 @@ _autoenv_hash_pair() {
       echo "Missing file argument for _autoenv_hash_pair!" >&2
       return 1
     fi
-    if [ $cksum_version = 2 ]; then
+    if [[ $cksum_version = 2 ]]; then
       # Get the output from `cksum` and join the first two words with a dot.
       env_cksum=${(j:.:)${:-$(cksum "$env_file")}[1,2]}
-    elif [ $cksum_version = 1 ]; then
-      env_cksum=$(shasum $env_file | cut -d' ' -f1)
+    elif [[ $cksum_version = 1 ]]; then
+      env_cksum=$(sha1sum $env_file | cut -d' ' -f1)
     else
       echo "Invalid version argument (${cksum_version}) for _autoenv_hash_pair!" >&2
       return 1