aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2020-10-25 16:58:57 -0400
committerMitch Riedstra <mitch@riedstra.us>2020-10-25 16:58:57 -0400
commit5640cbe7d1433ff9a7a903f961d6f963c5880080 (patch)
treeb1c743c5588f29109aef9e9668bd20d398dda758 /build.sh
parent7752715a53155e4809f91e5894dfb2e9b3d35544 (diff)
downloaddeduplicator-master.tar.gz
deduplicator-master.tar.xz
Add a build script. Basic readme. License file.HEADmaster
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..de7f434
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+LICENSE="$(cat LICENSE)"
+
+version="$(git log --format="%h %d" -1)
+$(go version)
+Build Date: $(date)
+Commit Author: $(git log --format="%an" -1)
+Commit date: $(git log --format="%aD" -1)
+
+Source code can be found here:
+https://git.riedstra.dev/mitch/deduplicator
+
+$LICENSE"
+
+if ! git diff-index --quiet HEAD ; then
+ version="dirty: $version"
+fi
+
+export CGO_ENABLED=0
+
+go build -ldflags="-X 'main.VersionString=$version'" -o deduplicator main.go