Add commands for checking for upgrade and upgrading src CLI in place
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.
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 Absolutely! We would love you to take this on. @slimsag What do you think about the suggested approach?
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:
Hey @joshuabezaleel, I think the src version command does what src update check is supposed to do. But src version is newer.