Skip to content

"Update your CLI" warnings when your CLI is out of date #59

@charlesHetterich

Description

@charlesHetterich

Every time a command runs, if your CLI is out of date, before the command runs, print out a warning message instructing the user to update their CLI. This is inline to how tools like brew/ohmyzsh/node, etc. work.

Optionally make it interactive with a y/n prompt to trigger the update before running their command. This is more aggressive, similar to what OhMyZsh does.

The way this works without introducing delay is, every time you run a command:

  • check some local ~/.polkadot/playground-cli.json for latest_version & compare that to installed CLI version
  • trigger update warning if we're behind latest
  • Async/in parallel to the command running, query the latest SemVer of the CLI and update some ~/.polkadot/playground-cli.json

This allows consumer CLIs to know when their CLI is out of date & needs to be updated without making the user wait for a query to github every time they run a CLI command

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions