From 320d5bbd01d39f7c5041e5294af24786c0338b61 Mon Sep 17 00:00:00 2001 From: Marcus Lacerda Date: Tue, 28 May 2019 11:22:01 +0200 Subject: [PATCH] Brew/snap readme update (#294) * Add brew info in version, update readme * Polish download section of readme * Updated brew instructions in version command --- README.md | 34 ++++++++++++++++++++++++++++++++-- cmd/utils.go | 16 +++++++++++----- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3431bfd2..395049e3 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,43 @@ Corectl is a command line tool to perform reloads, fetch metadata and evaluate e ## Download -On **Linux** and **OS X** +### snap + +If you want to install `corectl` using snap you can run: + +```bash +sudo snap install qlik-corectl +``` + +This installs `qlik-corectl` with the alias `corectl`, so you can still use it as normal (without the `qlik-` prefix). + +### brew + +If you want to install `corectl` using brew you have to first tap our homebrew repo with the following: + +```bash +brew tap qlik-oss/taps +``` + +after which you can install `corectl` by running: + +``` +brew install qlik-corectl +``` + +Note that the binary is still installed as `corectl`. + +### curl + +If you want to install using curl instead, you can use: + +For **Linux** or **OS X** ```bash curl --silent --location "https://github.com/qlik-oss/corectl/releases/latest/download/corectl-$(uname -s)-x86_64.tar.gz" | tar xz -C /tmp && mv /tmp/corectl /usr/local/bin/corectl ``` -On **Windows** with git bash +For **Windows** with git bash ```bash curl --silent --location "https://github.com/qlik-oss/corectl/releases/latest/download/corectl-windows-x86_64.zip" > corectl.zip && unzip ./corectl.zip -d "$HOME/bin/" && rm ./corectl.zip diff --git a/cmd/utils.go b/cmd/utils.go index 6130e3ec..e751d4d6 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -66,7 +66,9 @@ func checkLatestVersion() { } res, err := latest.Check(githubTag, version) if err != nil { - internal.FatalError("Could not find latest version:", err) + // If we cannot connect to github just print the version + fmt.Printf("corectl version: %s\n", version) + return } if res.Outdated { // Find absolute path of executable @@ -74,10 +76,14 @@ func checkLatestVersion() { fmt.Println("--------------------------------------------------") fmt.Printf("corectl version: %s, latest version is %s\n", version, res.Current) switch runtime.GOOS { - // case "darwin": - // fmt.Println("To update to the latest version using brew just run:") - // fmt.Print("\n brew upgrade qlik-corectl\n\n") - // fmt.Println("If you prefer curl, you can run:") + case "darwin": + fmt.Println("To update to the latest version using brew just run:") + fmt.Print("\n brew upgrade qlik-corectl\n\n") + fmt.Println("If you don't already have the qlik-oss tap you have to first add the tap with:") + fmt.Print("\n brew tap qlik-oss/taps\n\n") + fmt.Println("And after that, you have to install it with brew by running:") + fmt.Print("\n brew install qlik-corectl\n\n") + fmt.Println("If you prefer curl, you can run:") case "linux": fmt.Println("To update to the latest version using snap just run:") fmt.Print("\n snap refresh qlik-corectl\n\n")