Skip to content

Commit 97b89f2

Browse files
committed
fix(global-cli): restore "Failed to update" wording for vp update -g
`managed_update` was delegating to `managed_install` after the recent extract, which made `vp update -g` print "Failed to install {pkg}" on error instead of the original "Failed to update {pkg}". Inline the loop in `managed_update` so the verb matches the user's command. Also drop unused `raw_stderr_inline` from `vite_shared::output`. The companion `raw_stderr` is still exported and used; the inline variant was added speculatively for symmetry with `raw_inline` but has no callers, so YAGNI — adding it back is a one-liner if needed. Closes two cursor bugbot findings on PR #1495.
1 parent a810f37 commit 97b89f2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

crates/vite_global_cli/src/cli.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,13 @@ async fn managed_update(packages: &[String]) -> Result<ExitStatus, Error> {
586586
} else {
587587
packages.to_vec()
588588
};
589-
managed_install(&to_update, None, false).await
589+
for package in &to_update {
590+
if let Err(e) = crate::commands::env::global_install::install(package, None, false).await {
591+
vite_shared::output::raw_stderr(&format!("Failed to update {package}: {e}"));
592+
return Ok(exit_status(1));
593+
}
594+
}
595+
Ok(ExitStatus::default())
590596
}
591597

592598
/// Run the CLI command.

crates/vite_shared/src/output.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,3 @@ pub fn raw_inline(msg: &str) {
6868
pub fn raw_stderr(msg: &str) {
6969
eprintln!("{msg}");
7070
}
71-
72-
/// Print a raw message to stderr without a trailing newline.
73-
#[allow(clippy::print_stderr, clippy::disallowed_macros)]
74-
pub fn raw_stderr_inline(msg: &str) {
75-
eprint!("{msg}");
76-
}

0 commit comments

Comments
 (0)