wash icon indicating copy to clipboard operation
wash copied to clipboard

Add support for automatic updates

Open autodidaddict opened this issue 4 years ago • 1 comments

Wash should check for newer versions of itself whenever it starts and, if it finds one, should automatically upgrade to that version. A corresponding wash update can be made available to perform a manual check / verbose update.

Not sure if this will "play nice" with versions of wash that were installed via packagecloud/etc, but the one thing that we should never force our developers to do is figure out how to manually upgrade wash after they've been using it for a while. Once it's on their machine, it should always be the newest version.

autodidaddict avatar Feb 09 '21 19:02 autodidaddict

For reference, here's some output from the Haskell CLI stack, where I've typed stack upgrade and it automatically did everything I needed, including switching to sudo since I forgot to do it myself. I think one problem I have as someone with multiple operating systems and a metric ton of installed software is I don't remember how I installed everything that I have, so if I can just wash upgrade, that means I don't have to remember if I used a brew port or apt or snap or if I manually installed it from a GH release binary, etc.

stack upgrade
Current Stack version: 2.1.3, available download version: 2.5.1
Newer version detected, downloading
Querying for archive location for platform: linux-x86_64-static
Querying for archive location for platform: linux-x86_64
Downloading from: https://github.com/commercialhaskell/stack/releases/download/v2.5.1/stack-2.5.1-linux-x86_64.tar.gz
Download complete, testing executable
Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0
New stack executable available at /home/kevin/.local/bin/stack
Also copying stack executable to /usr/local/bin/stack
Permission error when trying to copy: /usr/local/bin: copyFile:atomicCopyFileContents:withReplacementFile:openBinaryTempFile: permission denied (Permission denied)
Should I try to perform the file copy using sudo? This may fail
Try using sudo? (y/n) y
Going to run the following commands:

-  sudo cp /home/kevin/.local/bin/stack /usr/local/bin/stack.tmp
-  sudo mv /usr/local/bin/stack.tmp /usr/local/bin/stack
[sudo] password for kevin: 

sudo file copy worked!

autodidaddict avatar Mar 12 '21 13:03 autodidaddict

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!

stale[bot] avatar May 17 '23 18:05 stale[bot]