From 97fd56cf47550f0bf64f0da57e48c82d88eb8e7a Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 20 Sep 2018 03:26:38 -0700 Subject: [PATCH] cmd/lncli: display build.Version() for commit hash --- cmd/lncli/main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index 7a698f078..3588ba57d 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -15,6 +15,7 @@ import ( macaroon "gopkg.in/macaroon.v2" "github.com/btcsuite/btcutil" + "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/lncfg" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/macaroons" @@ -34,10 +35,6 @@ const ( ) var ( - // Commit stores the current commit hash of this build. This should be - // set using -ldflags during compilation. - Commit string - defaultLndDir = btcutil.AppDataDir("lnd", false) defaultTLSCertPath = filepath.Join(defaultLndDir, defaultTLSCertFilename) ) @@ -205,7 +202,7 @@ func extractPathArgs(ctx *cli.Context) (string, string, error) { func main() { app := cli.NewApp() app.Name = "lncli" - app.Version = fmt.Sprintf("%s commit=%s", "0.5", Commit) + app.Version = build.Version() app.Usage = "control plane for your Lightning Network Daemon (lnd)" app.Flags = []cli.Flag{ cli.StringFlag{