Skip to content

Commit

Permalink
fix: pixi global sync reports after each handled environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Dec 12, 2024
1 parent 311bd35 commit 6b263c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cli/global/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ pub async fn execute(args: Args) -> miette::Result<()> {
}

let mut errors = Vec::new();
let mut has_changed = false;
for env_name in project.environments().keys() {
match project.sync_environment(env_name, None).await {
Ok(state_change) => state_changes |= state_change,
Ok(state_change) if state_change.has_changed() => {
has_changed = true;
state_change.report();
}
Ok(_) => (),
Err(err) => errors.push((env_name, err)),
}
}

if state_changes.has_changed() {
state_changes.report();
} else {
if !has_changed {
eprintln!(
"{}Nothing to do. The pixi global installation is already up-to-date.",
console::style(console::Emoji("✔ ", "")).green()
Expand Down

0 comments on commit 6b263c9

Please sign in to comment.