Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Brew/snap readme update (#294)
Browse files Browse the repository at this point in the history
* Add brew info in version, update readme

* Polish download section of readme

* Updated brew instructions in version command
  • Loading branch information
glooms committed May 28, 2019
1 parent a6ea9f6 commit 320d5bb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,24 @@ 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
executable, _ := os.Executable()
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")
Expand Down

0 comments on commit 320d5bb

Please sign in to comment.