diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8e920e2d..577f3311b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm The `rover template` commands now include four more languages. +- **Allow skip checking new versions of rover - @tsing, #1394** + + The checking can be skipped by the global `--skip-update` flag. + ## 🐛 Fixes - **Properly report errors when the first `rover dev` process starts up - @EverlastingBugstopper, #1342** diff --git a/src/cli.rs b/src/cli.rs index 71a8627944..14ca74c3bd 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -93,6 +93,10 @@ pub struct Rover { )] client_timeout: ClientTimeout, + /// Skip checking for newer versions of rover. + #[clap(long = "skip-update", global = true)] + skip_update: bool, + #[clap(skip)] #[serde(skip_serializing)] env_store: LazyCell, @@ -172,10 +176,10 @@ impl Rover { // before running any commands, we check if rover is up to date // this only happens once a day automatically // we skip this check for the `rover update` commands, since they - // do their own checks - + // do their own checks. + // the check is also skipped if the `--skip-update` flag is passed. if let Command::Update(_) = &self.command { /* skip check */ - } else { + } else if !self.skip_update { let config = self.get_rover_config(); if let Ok(config) = config { let _ = version::check_for_update(config, false, self.get_reqwest_client()?);