14 lines
319 B
Bash
Executable File
14 lines
319 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
gitchanges="false"
|
|
if [[ `git status --porcelain` ]]; then
|
|
gitchanges="true"
|
|
fi
|
|
gitsha1=$(git rev-parse HEAD | head -c 9)
|
|
buildtime=$(date --iso-8601=seconds)
|
|
|
|
go build -ldflags "-X main.gitChanges=$gitchanges -X main.gitSHA1=$gitsha1 -X main.buildTime=$buildtime"
|