summaryrefslogtreecommitdiff
path: root/build.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-11-01 13:55:35 +0100
committerJakob Unterwurzacher2015-11-01 14:04:29 +0100
commit3f490d4d86067761e6fdddd438f6fd045b7e58ef (patch)
tree4800448ca10636995000bb9bcedd3d636178a9ed /build.bash
parentaf923d2d16e0eedc7d2c203e28a42b6af49a51f5 (diff)
Bake version string into binary, add "--version" switch
Example: ./gocryptfs -version gocryptfs v0.2-20-gabcef9e-dirty; on-disk format 1 Note that you MUST compile using "./build.bash" for this to work.
Diffstat (limited to 'build.bash')
-rwxr-xr-xbuild.bash4
1 files changed, 3 insertions, 1 deletions
diff --git a/build.bash b/build.bash
index 8d985d0..c4b7121 100755
--- a/build.bash
+++ b/build.bash
@@ -2,4 +2,6 @@
set -eu
-go build
+GITVERSION=$(git describe --tags --dirty)
+
+go build -ldflags="-X main.GitVersion=$GITVERSION" && ./gocryptfs -version