clarinet
                                
                                 clarinet copied to clipboard
                                
                                    clarinet copied to clipboard
                            
                            
                            
                        Notify users when new minor versions of clarinet are available
Good idea. The GitHub API could be useful for implementing that - https://docs.github.com/en/rest/reference/releases#get-the-latest-release
Hello @lgalabru and @obycode! Reviving this topic...
It seems that GitHub API needs a token to call the latest release endpoint. How that would be handled by clarinet? I mean, an authentication token will be need and the token information will be publicly available.
Probably there is something more secure to base this feature on (call to a private service, call to package managers, etc). Any idea on that? What you think?
Cheers!
hey @csgui! handling an API token in Clarinet could be a bit tedious. How about relying on Brew's API? https://formulae.brew.sh/api/formula/clarinet.json should do the work?
Yep @lgalabru ! Homebrew seems a reliable source of data for the need here.
We can extract the latest released version from the map below:
"versions": {
    "stable": "1.3.0",
    "head": "HEAD",
    "bottle": true
}
If this task is aligned with clarinet priorities, I can be responsible to implement that. :-)
nice, that'd be helpful if we want to avoid version fragmentation + helping developers running the latest version.
There could be a relationship / dependency with this feature https://github.com/hirosystems/clarinet/issues/439, where we want to write some settings on disk (ideally respecting platform conventions so .settings/clarinet.json for linux, Library/Application Data/clarinet for macos, not sure for windows).
We could start with a schema as simple as:
{
   "update_check_enabled": true,
   "last_update_check": 1672070945
}
Hitting the brew API for every single command would be pretty annoying for developers and brew, and this preference file would be very useful for future features.
Probably also related with #205 where a TOML config file was discussed. What you think?
yes we could definitely go with a toml, no strong opinion on my end!
I noticed today that gh had a nice friendly way of doing this. I ran a command and after the output, it said:
A new release of gh is available: 2.29.0 → 2.30.0
To upgrade, run: brew upgrade gh
https://github.com/cli/cli/releases/tag/v2.30.0
Their implementation is in Go, but the process they used could be informative.