Skip to content
This repository was archived by the owner on Mar 14, 2019. It is now read-only.

Commit

Permalink
Fixed #65: Skip checksum if shasum is unsupported during installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jushi committed Jul 11, 2012
1 parent a65f5c8 commit 6f77c5d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions bin/install
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#! /bin/bash

CHECKSUM="checksum"

curl -Lk https://api.github.com/repos/zhongl/HouseMD/downloads | grep -E "[0-9a-f]+\s+[^ \"]+" -o > $CHECKSUM

JAR_NAME=`cat $CHECKSUM | grep -E housemd.+ -o`

curl -Lk https://github.com/downloads/zhongl/HouseMD/$JAR_NAME > $JAR_NAME

shasum -c $CHECKSUM || {
rm -rf $JAR_NAME $CHECKSUM ;
echo "Download failed, please try again!";
exit 1;
}
SHASUM=`which shasum || which sha1sum`

if [ -z $SHASUM ]; then
echo "Warning, shasum or sha1sum could not find to validate the download jar."
else
$SHASUM -c $CHECKSUM || {
rm -rf $JAR_NAME $CHECKSUM ;
echo "Download failed, please try again!";
exit 1;
}
fi

mv $JAR_NAME housemd.jar
rm -rf $CHECKSUM
Expand Down

0 comments on commit 6f77c5d

Please sign in to comment.