amonks / run

Go run some tasks!
https://amonks.github.io/run/
Other
19 stars 4 forks source link

autoupdates #104

Open amonks opened 5 months ago

amonks commented 5 months ago

It's weird that people don't get skeeved out by autoupdates the way they do about "telemetry" (as they are effectively the same thing). But... that's fine! It means we can add autoupdates without fear of controversy.

ui

I'm picturing a statusbar widget with two states:

v1.0.0-beta.24
v1.0.0-beta.24 (update available; press u to install)

checking for updates

  1. what version am I running?
  2. what is the latest version?
  3. so… should I offer to update?

1 is easy; we already have this in meta.go.

2 would involve hitting the github releases API. Or maybe we put a proxy in front of that so we can get some telemetry? 😅.

3 is easy, too. We probably -don't ever- want to update if you're not running a release build (annoying in dev), and we probably -always- want to update if you are running a release build which is not latest.

If we put all of this in the TUI we don't have to care about avoiding updates in CI/prod use cases: they wouldn't use the TUI anyway so they are immune.

installing updates

I did this in https://github.com/amonks/piano-alone using https://github.com/inconshreveable/go-update, and it worked just dandy. It checks where the binary is installed and replaces it, so we don't have to think about PATH stuff like we would for an installer.