Commit 3811dd84f552b3c0a1f59028167e0e78e90ead38

Authored by Corey Jewett
1 parent 3e76602f83

localize and don't leak cross-platform md5

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -15,9 +15,6 @@ local _ANTIGEN_INSTALL_DIR="$(cd "$(dirname "$0")" && pwd)"
15 15 typeset -a __deferred_compdefs
16 16 compdef () { __deferred_compdefs=($__deferred_compdefs "$*") }
17 17  
18   -# bsd/osx md5 v.s. linux md5sum
19   -chksum() { (md5sum; test $? = 127 && md5) 2>/dev/null | cut -d' ' -f1 }
20   -
21 18 # Syntaxes
22 19 # antigen-bundle <url> [<loc>=/]
23 20 # Keyword only arguments:
... ... @@ -497,7 +494,9 @@ antigen-snapshot () {
497 494 echo -n " created_on='$(date)';"
498 495  
499 496 # Add a checksum with the md5 checksum of all the snapshot lines.
  497 + chksum() { (md5sum; test $? = 127 && md5) 2>/dev/null | cut -d' ' -f1 }
500 498 local checksum="$(echo "$snapshot_content" | chksum)"
  499 + unset -f chksum;
501 500 echo -n " checksum='${checksum%% *}';"
502 501  
503 502 # A newline after the metadata and then the snapshot lines.