aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart/src/commands')
-rw-r--r--crates/mozart/src/commands/bump.rs45
-rw-r--r--crates/mozart/src/commands/update.rs5
2 files changed, 29 insertions, 21 deletions
diff --git a/crates/mozart/src/commands/bump.rs b/crates/mozart/src/commands/bump.rs
index 105379f..f295cd9 100644
--- a/crates/mozart/src/commands/bump.rs
+++ b/crates/mozart/src/commands/bump.rs
@@ -159,31 +159,36 @@ pub async fn execute(
let total_changes = require_changes.len() + require_dev_changes.len();
if total_changes == 0 {
- println!("Nothing to bump.");
+ println!(
+ "{}",
+ mozart_core::console::info(&format!(
+ "No requirements to update in {}.",
+ composer_json_path.display()
+ ))
+ );
return Ok(());
}
- // Print what would change
- for (name, old, new) in require_changes.iter().chain(require_dev_changes.iter()) {
- if args.dry_run {
+ if args.dry_run {
+ println!(
+ "{}",
+ mozart_core::console::info(&format!(
+ "{} would be updated with:",
+ composer_json_path.display()
+ ))
+ );
+ for (name, _old, new) in &require_changes {
println!(
- "{}: {} → {}",
- mozart_core::console::info(name),
- old,
- mozart_core::console::comment(new)
+ "{}",
+ mozart_core::console::info(&format!(" - require.{name}: {new}"))
);
- } else {
+ }
+ for (name, _old, new) in &require_dev_changes {
println!(
- "Bumping {} from {} to {}",
- mozart_core::console::info(name),
- old,
- mozart_core::console::comment(new)
+ "{}",
+ mozart_core::console::info(&format!(" - require-dev.{name}: {new}"))
);
}
- }
-
- if args.dry_run {
- println!("\n{} constraint(s) would be bumped.", total_changes);
// Return exit code 1 when dry-run detects changes (useful for CI to detect un-bumped constraints)
return Err(mozart_core::exit_code::bail_silent(
mozart_core::exit_code::GENERAL_ERROR,
@@ -210,10 +215,10 @@ pub async fn execute(
updated_lock.write_to_file(&lock_path)?;
println!(
- "\n{}",
+ "{}",
mozart_core::console::info(&format!(
- "{} constraint(s) bumped successfully.",
- total_changes
+ "{} has been updated ({total_changes} changes).",
+ composer_json_path.display()
))
);
diff --git a/crates/mozart/src/commands/update.rs b/crates/mozart/src/commands/update.rs
index 7924eca..7fbec1c 100644
--- a/crates/mozart/src/commands/update.rs
+++ b/crates/mozart/src/commands/update.rs
@@ -1104,7 +1104,10 @@ pub async fn execute(
updated_lock.content_hash = new_hash;
updated_lock.write_to_file(&lock_path)?;
- console.info(&format!("{} constraint(s) bumped.", bumped));
+ console.info(&format!(
+ "{} has been updated ({bumped} changes).",
+ composer_json_path.display()
+ ));
}
}