aptos-core
aptos-core copied to clipboard
Tell user if their CLI is out of date
Description
This PR adds a notification to tell the user if their CLI is out of date. We print to stderr to not mess up the output of the CLI for piping.
Test Plan
- Lower the version of the CLI and build it locally.
- Move it somewhere else, e.g.
/tmp
- Run it:
$ /tmp/aptos info
===
A new version of the Aptos CLI is available: v1.0.3 -> v1.0.4
Run this command to update: aptos update
===
{
"Result": {
"build_branch": "main",
"build_cargo_version": "cargo 1.66.1 (ad779e08b 2023-01-10)",
"build_commit_hash": "9728485d20d17647200376d4f534436d5ddff65f",
"build_is_release_build": "false",
"build_os": "macos-aarch64",
"build_pkg_version": "1.0.3",
"build_profile_name": "debug",
"build_rust_channel": "1.66.1-aarch64-apple-darwin",
"build_rust_version": "rustc 1.66.1 (90743e729 2023-01-10)",
"build_tag": "",
"build_time": "2023-01-23 15:49:23 +00:00",
"build_using_tokio_unstable": "true"
}
}