Skip to content

Commit be48408

Browse files
committed
Include version info in dist build
1 parent 517a545 commit be48408

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cd $(cd `dirname "$0"`; cd ..; pwd)
33

44
VERSION=$1
55
if [ -z $VERSION ]; then
6-
echo "Error: VERSION must be set."
6+
echo "Usage: $0 VERSION"
77
exit 1
88
fi
99

@@ -20,7 +20,7 @@ for target in $TARGETS; do
2020
NAME=${NAME}.exe
2121
fi
2222

23-
go build -v -o pkg/${NAME}
23+
go build -ldflags "-X main.build_version $VERSION" -o pkg/${NAME}
2424

2525
pushd pkg
2626
zip terraform-inventory_${VERSION}_${GOOS}_${GOARCH}.zip ${NAME}

0 commit comments

Comments
 (0)