src-cli icon indicating copy to clipboard operation
src-cli copied to clipboard

Add commands for checking for upgrade and upgrading src CLI in place

Open ryan-blunden opened this issue 5 years ago • 4 comments

As a starting point, I like @slimsag 's suggestion from https://github.com/sourcegraph/src-cli/issues/18#issuecomment-425635219:

src update check -> checks for updates, doesn't apply them.
src update -> checks for updates, self-applies them. Will prompt for root/admin privileges.

I also liked @felixfbecker's suggestion of having a prompt to let the user know there is an upgrade available (screenshot taken from https://www.npmjs.com/package/update-notifier), but add logic so this is only displayed once per day, not on every invocation.

Screen Shot 2020-04-22 at 9 15 17 AM

ryan-blunden avatar Apr 21 '20 23:04 ryan-blunden

Hi @ryan-blunden , will this be open to public contribution? :slightly_smiling_face:

I think for src update check I can use google/go-github to get the latest version available.

I am still not sure for the second one, src update, though. What comes in my mind is using Go's os and os/exec to do some "scripting" for "automatically" download the binary and put it at the appropriate folder like the one in the README's installation steps. What do you think?

Thank you very much in advance! :slightly_smiling_face:

joshuabezaleel avatar May 14 '20 20:05 joshuabezaleel

@joshuabezaleel Absolutely! We would love you to take this on. @slimsag What do you think about the suggested approach?

ryan-blunden avatar May 14 '20 21:05 ryan-blunden

Hi @slimsag , if it would be okay I want to ask questions on this particular issue. For src update check, how would it be different with the current src version since the version command also output the recommended latest version from /.api/src-cli/version? Thank you in advance! :slightly_smiling_face:

joshuabezaleel avatar Jun 03 '20 09:06 joshuabezaleel

Hey @joshuabezaleel, I think the src version command does what src update check is supposed to do. But src version is newer.

mrnugget avatar Jun 22 '20 11:06 mrnugget