summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-03-22 21:38:01 +0100
committerJakob Borg <jakob@nym.se>2014-03-22 21:38:01 +0100
commit145c8e40637e086edb78f6c36c36251234b24706 (patch)
tree912ca0e216ee1fd13c719bd343690600ce55b265
parent52cad94e86a572d5a2f5c2d27ae6a16c4619d409 (diff)
Only sign if the key is present
-rwxr-xr-xbuild.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 8bf588fc9c..495581f37e 100755
--- a/build.sh
+++ b/build.sh
@@ -25,12 +25,19 @@ test() {
go test -cpu=1,2,4 ./...
}
+sign() {
+ id=BCE524C7
+ if gpg --list-keys "$id" >/dev/null 2>&1 ; then
+ gpg -ab -u "$id" "$1"
+ fi
+}
+
tarDist() {
name="$1"
rm -rf "$name"
mkdir -p "$name"
cp syncthing "${distFiles[@]}" "$name"
- gpg -ab "$name/syncthing"
+ sign "$name/syncthing"
tar zcvf "$name.tar.gz" "$name"
rm -rf "$name"
}
@@ -40,7 +47,7 @@ zipDist() {
rm -rf "$name"
mkdir -p "$name"
cp syncthing.exe "${distFiles[@]}" "$name"
- gpg -ab "$name/syncthing.exe"
+ sign "$name/syncthing.exe"
zip -r "$name.zip" "$name"
rm -rf "$name"
}