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

Check for latest release when running the version command - #153

Merged
wennmo merged 4 commits into
masterfrom
latest
Mar 13, 2019
Merged

wennmo merged 4 commits into
masterfrom
latest

Conversation

@wennmo

@wennmo wennmo commented Mar 13, 2019 •

Copy link
Copy Markdown
Member

This PR adds a check for latest release on github when running the version command. Will only be executed on binaries built with a main.version. Will also generate a download string based on OS and executable path to update the tool.

➜  corectl git:(latest) go build -ldflags "-X main.version=0.2.0" -o corectl main.go
➜  corectl git:(latest) ./corectl version
-------------------------------------------------
Version 0.2.0 is not latest, you should upgrade to 0.4.0 
To download the latest version you can use this command: 
'curl --silent --location "https://github.com/qlik-oss/corectl/releases/download/v0.4.0/corectl-darwin-x86_64.tar.gz" | tar xz -C /tmp && mv /tmp/corectl /Users/mow/gits/qlik-oss/corectl'
-------------------------------------------------
corectl version: 0.2.0

This closes #48

@wennmo
wennmo requested review from axelssonHakan and peol March 13, 2019 14:11
@peol

peol commented Mar 13, 2019

Copy link
Copy Markdown

Version 0.2.0 is not latest, you should upgrade to 0.4.0 sounds a little bit bossy :)

Perhaps something like There is a new version available! Please upgrade for the latest features and bug fixes. You are on 0.2.0, latest version is 0.4.0.

@wennmo
wennmo merged commit ee14d8a into master Mar 13, 2019
@wennmo
wennmo deleted the latest branch March 13, 2019 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Corectl new version notification / update

2 participants

⌂ 换网址