From 32d65fb075579bbd6b8dfc753d19133c4be79596 Mon Sep 17 00:00:00 2001 From: takashabe Date: Sun, 19 May 2019 10:39:20 +0900 Subject: [PATCH 1/6] Added printing the go.mod version --- cmd/btcli/btcli.go | 12 +++++++++--- pkg/cmd/interactive/interactive.go | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/btcli/btcli.go b/cmd/btcli/btcli.go index baf1484..ec000a5 100644 --- a/cmd/btcli/btcli.go +++ b/cmd/btcli/btcli.go @@ -2,22 +2,28 @@ package main import ( "os" + "runtime/debug" "github.com/takashabe/btcli/pkg/cmd/interactive" ) // App version var ( - Version = "undefined" - Revision = "undefined" + Version = "undefined" + Sum = "undefined" ) func main() { + if i, ok := debug.ReadBuildInfo(); ok { + Version = i.Main.Version + Sum = i.Main.Sum + } + cli := &interactive.CLI{ OutStream: os.Stdout, ErrStream: os.Stderr, Version: Version, - Revision: Revision, + Sum: Sum, } os.Exit(cli.Run(os.Args)) } diff --git a/pkg/cmd/interactive/interactive.go b/pkg/cmd/interactive/interactive.go index 26ab38b..46a68be 100644 --- a/pkg/cmd/interactive/interactive.go +++ b/pkg/cmd/interactive/interactive.go @@ -29,13 +29,13 @@ type CLI struct { OutStream io.Writer ErrStream io.Writer - Version string - Revision string + Version string + Sum string } // Run invokes the CLI with the given arguments func (c *CLI) Run(args []string) int { - fmt.Fprintf(c.OutStream, "btcli Version: %s(%s)\n", c.Version, c.Revision) + fmt.Fprintf(c.OutStream, "btcli Version: %s(%s)\n", c.Version, c.Sum) fmt.Fprintf(c.OutStream, "Please use `exit` or `Ctrl-D` to exit this program.\n") conf, err := c.loadConfig(args) From a442232901fe6d272fef987c575bc5d03ce05076 Mon Sep 17 00:00:00 2001 From: takashabe Date: Wed, 22 May 2019 10:47:34 +0900 Subject: [PATCH 2/6] Fix introduction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5254957..48592b2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # btcli -CLI client for the Bigtable with auto-completion. +btcli is a CLI client for the Bigtable. Has many read options and auto-completion. ![tty](https://user-images.githubusercontent.com/681508/44247754-9ad3ea80-a221-11e8-9172-2cb709e1420a.gif) From 8db797787d5b50db1209297520026de8891a72b6 Mon Sep 17 00:00:00 2001 From: takashabe Date: Sat, 1 Jun 2019 00:07:42 +0900 Subject: [PATCH 3/6] Fix docker image --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 333f942..9adce41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,13 +2,13 @@ version: 2 jobs: build: docker: - - image: circleci/golang:1.11.2 + - image: golang/1.12-alpine environment: BIGTABLE_EMULATOR_HOST: 127.0.0.1:8864 - image: google/cloud-sdk command: gcloud beta emulators bigtable start --host-port 0.0.0.0:8864 --project test-project - working_directory: ~/github.com/takashabe/btcli + working_directory: $HOME/github.com/takashabe/btcli steps: - checkout From a01869d25c969ef3e5f5f3e3e695a39e6410c552 Mon Sep 17 00:00:00 2001 From: takashabe Date: Sun, 2 Jun 2019 19:29:51 +0900 Subject: [PATCH 4/6] Fix image name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9adce41..c865154 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: golang/1.12-alpine + - image: golang:1.12-alpine environment: BIGTABLE_EMULATOR_HOST: 127.0.0.1:8864 - image: google/cloud-sdk From 88c3534257c8b460484e665cc2324d589df5efab Mon Sep 17 00:00:00 2001 From: takashabe Date: Sun, 2 Jun 2019 19:33:19 +0900 Subject: [PATCH 5/6] circleci image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c865154..f8e8249 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: golang:1.12-alpine + - image: circleci/golang:1.12 environment: BIGTABLE_EMULATOR_HOST: 127.0.0.1:8864 - image: google/cloud-sdk From 765e5609b69102e88113d507b1615c70f173eb8f Mon Sep 17 00:00:00 2001 From: takashabe Date: Sun, 2 Jun 2019 19:35:08 +0900 Subject: [PATCH 6/6] fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8e8249..deca6dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: - image: google/cloud-sdk command: gcloud beta emulators bigtable start --host-port 0.0.0.0:8864 --project test-project - working_directory: $HOME/github.com/takashabe/btcli + working_directory: ~/github.com/takashabe/btcli steps: - checkout