Skip to content

Commit

Permalink
chore: 优化没有镜像时update index的提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed Jul 13, 2024
1 parent bf0d722 commit 8eaa56c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,14 @@ fn router(action: Action) -> Result<String> {
.map(|name| format!("Success:Index of mirror '{name}' has been updated"))
} else {
mirror_update_all().map(|names| {
format!(
"Success:Index of mirrors '({name})' has been updated",
name = names.join(", ")
)
if names.is_empty() {
"Warning:No mirror has been added".to_string()
} else {
format!(
"Success:Index of mirrors '({name})' has been updated",
name = names.join(", ")
)
}
})
}
}
Expand Down

0 comments on commit 8eaa56c

Please sign in to comment.