Skip to content

Update capability to replace arkade with a newer version #973

Open
@alexellis

Description

@alexellis

It would be possible to self-update by running arkade update and having the running binary replaced by a newer version.

arkade get arkade has the logic to download the latest version, but we need something to replace this version.

I'd also like to see the self-check only download the binary if there's a newer version, something which we can find a way to optimise.

This way, people could add arkade update to their .bashrc, profile, or a daily cron.

Expected Behaviour

Update command can replace the running version

Current Behaviour

It prints out install instructions, which can be copy/pasted

Possible Solution

  • Use the equivalent code of arkade get arkade to get an updated version
  • Move that file to replace the location of the currently running binary
  • Make sure this only downloads the ~ 10MB binary, if it's required

I want to avoid using any self-updating libraries or external dependencies. We did this for another project using stdlib.

Context

I've been seeing a lot more breakages recently with projects changing binary names and formats, this would make arkade self-update, and work better for when we've fixed issues introduced by upstream projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions