diff --git a/antigen.zsh b/antigen.zsh index 2ffb667..cc48135 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -15,6 +15,9 @@ local _ANTIGEN_INSTALL_DIR="$(cd "$(dirname "$0")" && pwd)" typeset -a __deferred_compdefs compdef () { __deferred_compdefs=($__deferred_compdefs "$*") } +# bsd/osx md5 v.s. linux md5sum +chksum() { (md5sum; test $? = 127 && md5) 2>/dev/null | cut -d' ' -f1 } + # Syntaxes # antigen-bundle [=/] # Keyword only arguments: @@ -494,7 +497,7 @@ antigen-snapshot () { echo -n " created_on='$(date)';" # Add a checksum with the md5 checksum of all the snapshot lines. - local checksum="$(echo "$snapshot_content" | md5sum)" + local checksum="$(echo "$snapshot_content" | chksum)" echo -n " checksum='${checksum%% *}';" # A newline after the metadata and then the snapshot lines.