Skip to content

Commit

Permalink
Making md5sum the default executable, to fix an issue on Cygwin, whic…
Browse files Browse the repository at this point in the history
…h doesn't have a correctly formatted MACHTYPE.
  • Loading branch information
Gabe McArthur committed Jul 12, 2011
1 parent a9079f6 commit 19dd415
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/md5
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ file="${args[0]}"
md5="${args[1]}"
args="$(echo ${args[@]:2}) " # Strip trailing / leading / extra spacing.

if [[ "$MACHTYPE" =~ linux ]]
then
command="md5sum"
elif [[ "$MACHTYPE" =~ darwin ]]
if [[ "$MACHTYPE" =~ darwin ]]
then
command="/sbin/md5 -q"
else
command="md5sum"
fi

file_md5=$($command "$file" | awk '{print $1}')
Expand Down

0 comments on commit 19dd415

Please sign in to comment.