Add build script, generate version string on build time, modify usage and add version info
This commit is contained in:
parent
8538df7a14
commit
9364b82e08
4 changed files with 23 additions and 1 deletions
10
build.sh
Executable file
10
build.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ver="$(git rev-parse --short HEAD)"
|
||||
|
||||
if ! git diff-index --quiet HEAD
|
||||
then
|
||||
ver="${ver}-dev"
|
||||
fi
|
||||
|
||||
go build -ldflags="-X 'main.Version=${ver}'" -o ass_v${ver}
|
Reference in a new issue