Skip to content

Commit

Permalink
Add --skip-update-check for skip checking new versions of rover
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Wang committed Nov 3, 2022
1 parent 5b1263e commit c474289
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ pub struct Rover {
)]
client_timeout: ClientTimeout,

/// Skip checking for newer versions of rover.
#[clap(long = "skip-update-check", global = true)]
skip_update_check: bool,

#[clap(skip)]
#[serde(skip_serializing)]
env_store: LazyCell<RoverEnv>,
Expand Down Expand Up @@ -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-check` flag is passed.
if let Command::Update(_) = &self.command { /* skip check */
} else {
} else if !self.skip_update_check {
let config = self.get_rover_config();
if let Ok(config) = config {
let _ = version::check_for_update(config, false, self.get_reqwest_client()?);
Expand Down

0 comments on commit c474289

Please sign in to comment.