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
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:
~/.polkadot/playground-cli.jsonforlatest_version& compare that to installed CLI version~/.polkadot/playground-cli.jsonThis 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