Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/turborepo-lib/src/shim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use tiny_gradient::{GradientStr, RGB};
use tracing::{debug, warn};
pub use turbo_state::TurboState;
use turbo_updater::display_update_check;
use turbo_updater::{display_update_check, should_skip_notification};
use turbopath::AbsoluteSystemPathBuf;
use turborepo_repository::{
inference::{RepoMode, RepoState},
Expand Down Expand Up @@ -313,10 +313,10 @@
current_version: &str,
config: &crate::config::ConfigurationOptions,
package_manager: Result<&PackageManager, &package_manager::Error>,
) {

Check warning on line 316 in crates/turborepo-lib/src/shim/mod.rs

View workflow job for this annotation

GitHub Actions / Rust lints

Diff in /home/runner/work/turborepo/turborepo/crates/turborepo-lib/src/shim/mod.rs

Check warning on line 316 in crates/turborepo-lib/src/shim/mod.rs

View workflow job for this annotation

GitHub Actions / Rust lints

Diff in /home/runner/work/turborepo/turborepo/crates/turborepo-lib/src/shim/mod.rs
let package_manager = package_manager.unwrap_or(&PackageManager::Npm);

if args.should_check_for_update() && !config.no_update_notifier() {
if args.should_check_for_update() && !config.no_update_notifier() && !should_skip_notification() {
// custom footer for update message
let footer = format!(
"Follow {username} for updates: {url}",
Expand Down
7 changes: 1 addition & 6 deletions crates/turborepo-updater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn get_tag_from_version(pre: &semver::Prerelease) -> VersionTag {
}
}

fn should_skip_notification() -> bool {
pub fn should_skip_notification() -> bool {
NOTIFIER_DISABLE_VARS
.iter()
.chain(ENVIRONMENTAL_DISABLE_VARS.iter())
Expand All @@ -100,11 +100,6 @@ pub fn display_update_check(
interval: Option<Duration>,
package_manager: &PackageManager,
) -> Result<(), UpdateNotifierError> {
// bail early if the user has disabled update notifications
if should_skip_notification() {
return Ok(());
}

let version = check_for_updates(package_name, current_version, timeout, interval);

if let Ok(Some(version)) = version {
Expand Down
Loading