SquidDev-CC/mbs

[Suggestion] Update detector

Lupus590 opened this issue · 5 comments

I'll be willing to work on it, but I thought I should ask before I do.

I'm not too sure how I feel about this. I guess it could be useful, it seems a little overkill for such a small project.

I'm not sure when/where you're planning to fire it? I'm reluctant to do it at startup, as I suspect that'd require it being a synchronous HTTP request and that'll just slow down booting. I'm not opposed to the idea, but I think I'd need more information about your proposed implementation before going ahead.

Having a subcommand to manage updates seems like a better solution.

I was just thinking of the startup request, but now that you mentioned the boot slowdown I'm trying to think of other ways to do things.

Revised ideas:

  • Check on startup async and notify the user when control is returned to the shell. Issue: Update may get lost in the output of last run program.
  • Check on startup async and notify the user on the next startup. Issue: Requires two starts/restart to notify the user of the update.

@apemanzilla I'm not thinking about installing the update at the moment, although I could add a command for that (which perhaps also checks for updates)

Updates can be identified by looking at the sha of the commit with from: https://api.github.com/repos/SquidDev-CC/mbs/branches/master

With saving a local copy of the currently installed sha.

Having a subcommand to manage updates seems like a better solution.

Truth be told, this is pretty much mbs install but with some additional checking to ensure you don't download files which haven't changed.

  • Check on startup async and notify the user when control is returned to the shell. Issue: Update may get lost in the output of last run program.
  • Check on startup async and notify the user on the next startup. Issue: Requires two starts/restart to notify the user of the update.

My complaint with both of these is that it requires injecting the update code into the shell, is both kinda ugly and means people need to have the shell module enabled (though I don't know why people wouldn't). Ideally it'd be done through the mbs startup phase, but obviously that doesn't allow such asynchronous behaviour. One could use multishell, but then you require an advanced computer. It's times like these I wish CC had decent multi-process support.