aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/reinstall.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-06 03:38:32 +0900
committernsfisis <nsfisis@gmail.com>2026-05-06 04:05:13 +0900
commitbf96f8292c0e9818c8b5fc8713ca7506e4338a49 (patch)
tree61ddecc119ee0ae344eabdb9c0f784cdb3461a44 /crates/mozart/src/commands/reinstall.rs
parentb97e34358be5df05a3db9f5f3ef1502eaa94b1c0 (diff)
downloadphp-mozart-bf96f8292c0e9818c8b5fc8713ca7506e4338a49.tar.gz
php-mozart-bf96f8292c0e9818c8b5fc8713ca7506e4338a49.tar.zst
php-mozart-bf96f8292c0e9818c8b5fc8713ca7506e4338a49.zip
refactor(console): add write macros and migrate commands to use them
Diffstat (limited to 'crates/mozart/src/commands/reinstall.rs')
-rw-r--r--crates/mozart/src/commands/reinstall.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/mozart/src/commands/reinstall.rs b/crates/mozart/src/commands/reinstall.rs
index 7e426f8..b421bd8 100644
--- a/crates/mozart/src/commands/reinstall.rs
+++ b/crates/mozart/src/commands/reinstall.rs
@@ -1,5 +1,6 @@
use clap::Args;
use mozart_core::console_format;
+use mozart_core::console_writeln;
use mozart_core::package;
#[derive(Args)]
@@ -164,14 +165,14 @@ pub async fn execute(
for pkg in &selected {
let locked = find_locked_package(&all_locked, &pkg.name);
if let Some(lp) = locked {
- console.write_stdout(
+ console_writeln!(
+ console,
&format!(" - Would reinstall {} ({})", lp.name, lp.version),
- mozart_core::console::Verbosity::Normal,
);
} else {
- console.write_stdout(
+ console_writeln!(
+ console,
&format!(" - Would reinstall {} (not found in lock file)", pkg.name),
- mozart_core::console::Verbosity::Normal,
);
}
}
@@ -241,10 +242,7 @@ pub async fn execute(
}
if reinstalled_count == 0 {
- console.write_stdout(
- "Nothing was reinstalled.",
- mozart_core::console::Verbosity::Normal,
- );
+ console_writeln!(console, "Nothing was reinstalled.",);
return Ok(());
}