summaryrefslogtreecommitdiff
path: root/scripts/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 4ad10e03c..a71a0899a 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -2,7 +2,10 @@
set -eu
+# DEBUG returns whether DEBUG build is enabled.
+DEBUG() { [ ! -z "${DEBUG-}" ]; }
+
CGO_ENABLED=0 go build -trimpath \
- -tags 'netgo osusergo static_build' \
+ -tags "netgo osusergo static_build $(DEBUG && echo 'debugenv')" \
-ldflags="-s -w -extldflags '-static' -X 'main.Version=${VERSION:-$(git describe --tags --abbrev=0)}'" \
./cmd/gotosocial