Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(turborepo): Run update notifier on turbo that is actually executed #3190

Merged
11 changes: 9 additions & 2 deletions crates/turbo-updater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub fn check_for_updates(
current_version: &str,
timeout: Option<Duration>,
interval: Option<Duration>,
is_global_turbo: bool,
) -> Result<(), UpdateNotifierError> {
// bail early if the user has disabled update notifications
if should_skip_notification() {
Expand All @@ -128,6 +129,13 @@ pub fn check_for_updates(
.interval(interval);
if let Ok(Some(version)) = informer.check_version() {
let latest_version = version.to_string();
// TODO: make this package manager aware
let update_cmd = if is_global_turbo {
"npm i -g turbo".cyan().bold()
} else {
"npm i turbo".cyan().bold()
};

let msg = format!(
"
Update available {version_prefix}{current_version} ≫ {latest_version}
Expand All @@ -138,8 +146,7 @@ pub fn check_for_updates(
current_version = current_version.dimmed(),
latest_version = latest_version.green().bold(),
github_repo = github_repo,
// TODO: make this package manager aware
update_cmd = "npm i -g turbo".cyan().bold(),
update_cmd = update_cmd
);

if let Some(footer) = footer {
Expand Down