You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Output LDFlAGS for a given environment. LDFLAGS are applied to all go binary
8
+
# builds.
9
+
#
10
+
# Args: env
11
+
functionldflags() {
12
+
local GIT_VERSION=$(git describe --tags --always --dirty)
13
+
local GIT_COMMIT=$(git rev-parse HEAD)
14
+
15
+
local GIT_TREESTATE="clean"
16
+
if [[ $(git diff --stat)!='' ]];then
17
+
GIT_TREESTATE="dirty"
18
+
fi
19
+
20
+
local DATE_FMT="+%Y-%m-%dT%H:%M:%SZ"
21
+
local BUILD_DATE=$(date "$DATE_FMT")
22
+
local SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
23
+
if [ $SOURCE_DATE_EPOCH ]
24
+
then
25
+
local BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH""$DATE_FMT"2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH""$DATE_FMT"2>/dev/null || date -u "$DATE_FMT")
0 commit comments