From f38fe38d453f0777781e42c3645cca70d00b4586 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 12 Nov 2018 02:23:08 -0800 Subject: [PATCH] Use `git describe --tags` to set the version number when building the CLI --- cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/README.md b/cli/README.md index a2db7e7..831068b 100644 --- a/cli/README.md +++ b/cli/README.md @@ -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: