Use `git describe --tags` to set the version number when building the CLI

This commit is contained in:
Dale Hui 2018-11-12 02:23:08 -08:00
parent 323427e951
commit f38fe38d45
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ $ apt-get install -y migrate
```
$ go get -u -d github.com/golang-migrate/migrate/cli
$ cd $GOPATH/src/github.com/golang-migrate/migrate/cli
$ go build -tags 'postgres' -o /usr/local/bin/migrate github.com/golang-migrate/migrate/cli
$ go build -tags 'postgres' -ldflags="-X main.Version=$(git describe --tags)" -o /usr/local/bin/migrate github.com/golang-migrate/migrate/cli
```
##### Notes: