Commit 3e76602f837d1124fe00938da55015eb29bb105b

Authored by Corey Jewett
1 parent 6e46764655

cross platform md5

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

... ... @@ -15,6 +15,9 @@ 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 +
18 21 # Syntaxes
19 22 # antigen-bundle <url> [<loc>=/]
20 23 # Keyword only arguments:
... ... @@ -494,7 +497,7 @@ antigen-snapshot () {
494 497 echo -n " created_on='$(date)';"
495 498  
496 499 # Add a checksum with the md5 checksum of all the snapshot lines.
497   - local checksum="$(echo "$snapshot_content" | md5sum)"
  500 + local checksum="$(echo "$snapshot_content" | chksum)"
498 501 echo -n " checksum='${checksum%% *}';"
499 502  
500 503 # A newline after the metadata and then the snapshot lines.