-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New release checks script * Fix keystore check
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
|
||
APPDIR=Simplenote | ||
|
||
function pOk() { | ||
echo "[$(tput setaf 2)OK$(tput sgr0)]" | ||
} | ||
|
||
function pFail() { | ||
echo "[$(tput setaf 1)KO$(tput sgr0)]" | ||
} | ||
|
||
function printVersion() { | ||
gradle_version=$(grep -E 'version ".*"' $APPDIR/build.gradle | sed s/version// | grep -Eo "[a-zA-Z0-9.-]+" ) | ||
echo "$APPDIR/build.gradle version $gradle_version" | ||
} | ||
|
||
function checkFileAgainstHash() { | ||
filename=$1 | ||
known_checksum=$2 | ||
checksum=`sha1sum "$filename" | cut -d" " -f1` | ||
if [ x$checksum != x$known_checksum ]; then | ||
pFail | ||
exit 6 | ||
fi | ||
pOk | ||
} | ||
|
||
function checkGradleProperties() { | ||
/bin/echo -n "Check gradle.properties..." | ||
checkFileAgainstHash $APPDIR/gradle.properties 2e36d6696bc71af3bc976b838966ac40cf06e4fe | ||
} | ||
|
||
function checkKeystore() { | ||
keystore=`cat gradle.properties | grep storeFile | cut -d= -f 2 | sed -e 's/^[ ]*//'` | ||
/bin/echo -n "Check Keystore..." | ||
checkFileAgainstHash "$keystore" 7b20577a43b217b668fa875693c006d693679c0c | ||
} | ||
|
||
checkGradleProperties | ||
checkKeystore | ||
printVersion |