Skip to content

Commit

Permalink
Add --skip-update 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 b05464d commit 2408ba8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
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", global = true)]
skip_update: 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` 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()?);
Expand Down

0 comments on commit 2408ba8

Please sign in to comment.