aboutsummaryrefslogtreecommitdiff
path: root/build.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-06-19 20:34:54 +0200
committerJakob Unterwurzacher2016-06-19 20:35:28 +0200
commitaf07866e0892a6b94c977b122884ecdf0af5a0a2 (patch)
tree1e814f20d15b0b929c43144dc1d49f81c8af0473 /build.bash
parent930e597f5ae83ea5940b7196e45404daa14bf647 (diff)
build.bash: check if the go-fuse tree is dirty
If it is, append "-dirty" to the hash.
Diffstat (limited to 'build.bash')
-rwxr-xr-xbuild.bash14
1 files changed, 13 insertions, 1 deletions
diff --git a/build.bash b/build.bash
index 829953b..2ea499c 100755
--- a/build.bash
+++ b/build.bash
@@ -6,8 +6,20 @@ cd "$(dirname "$0")"
# gocryptfs version according to git
GITVERSION=$(git describe --tags --dirty)
+
# go-fuse version according to git
-GITVERSIONFUSE=$(cd $GOPATH/src/github.com/hanwen/go-fuse && git rev-parse --short HEAD)
+GITVERSIONFUSE=$(
+ cd $GOPATH/src/github.com/hanwen/go-fuse
+ SHORT=$(git rev-parse --short HEAD)
+
+ # Check if the tree is dirty, adapted from
+ # http://stackoverflow.com/a/2659808/1380267
+ if ! git diff-index --quiet HEAD; then
+ echo $SHORT-dirty
+ else
+ echo $SHORT
+ fi
+)
# Make sure we have the go binary
go version > /dev/null