-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show a message if a newer version is available #249
Comments
Thanks for the suggestion. Do you know of any other CLI tool that checks for updates in the background? I thought npm, github-cli and ngrok were unique cases in that they need to be up to date to keep up with their backing server. However, for tools installed via an installation script, perhaps a dedicated update-checker tool would be more ideal? |
No, I don't know such CLI tools.
I'm not sure because I can't imagine how it could be 🤔 |
(EDIT: I wrote the below thinking this was about an updater, not just a notifier, so some of it doesn't apply.) I definitely wouldn't want xh to check for updates on its own accord. A builtin updater you call manually might be reasonable, but it wouldn't be straightforward.
|
I was thinking of a tool that uses either update-informer or update-notifier to check for updates before spawning the command it received as the first argument $ update-checker xh httpbin.org/json
---------------------------------------
New version of xh is available: v0.17.0
---------------------------------------
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Length: 429
Content-Type: application/json
Date: Wed, 20 Apr 2022 22:49:04 GMT
Server: gunicorn/19.9.0
{
"slideshow": {
"author": "Yours Truly",
"date": "date of publication",
"slides": [
{
"title": "Wake up to WonderWidgets!",
"type": "all"
},
{
"items": [
"Why <em>WonderWidgets</em> are great",
"Who <em>buys</em> WonderWidgets"
],
"title": "Overview",
"type": "all"
}
],
"title": "Sample Slide Show"
}
}
# avoid typing update-checker by aliasing it to the command that needs to be up to date
$ alias xh="update-checker xh" Basic configuration needed by # update-checker.toml
[xh]
version = "xh -V"
repo = "ducaale/xh"
[rg]
version = "rg -V"
repo = "BurntSushi/ripgrep" You can then add an interactive setup to the |
terraform does that when you use 'terraform version'
Personally, I am using cargo install-update from time to time and this works the best for me. |
👋 Thank you for this awesome project!
I found this feature in the GitHub CLI application and npm.
I think it'll be useful for users who install
xh
using the installation script orcargo
.And this will let them know that a new version is available and it's time to update.
Ready-made crates to implement that:
The text was updated successfully, but these errors were encountered: