refactor(link): add Ok and make IoError more understandable
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
f17e2a5986
commit
4a0f855b67
1 changed files with 8 additions and 3 deletions
11
src/git.rs
11
src/git.rs
|
@ -598,6 +598,10 @@ impl Config {
|
||||||
let mut sp =
|
let mut sp =
|
||||||
Spinner::new(Spinners::Dots10, format!("{}: {}", link.name, op));
|
Spinner::new(Spinners::Dots10, format!("{}: {}", link.name, op));
|
||||||
match f(link) {
|
match f(link) {
|
||||||
|
Ok(_) => sp.stop_and_persist(
|
||||||
|
success_str(),
|
||||||
|
format!("{}: {}", link.name, op),
|
||||||
|
),
|
||||||
Err(e @ LinkError::AlreadyLinked(_, _)) => {
|
Err(e @ LinkError::AlreadyLinked(_, _)) => {
|
||||||
sp.stop_and_persist(success_str(), format!("{e}"))
|
sp.stop_and_persist(success_str(), format!("{e}"))
|
||||||
}
|
}
|
||||||
|
@ -613,9 +617,10 @@ impl Config {
|
||||||
Err(e @ LinkError::FailedCreatingLink(_, _)) => {
|
Err(e @ LinkError::FailedCreatingLink(_, _)) => {
|
||||||
sp.stop_and_persist(failure_str(), format!("{e}"))
|
sp.stop_and_persist(failure_str(), format!("{e}"))
|
||||||
}
|
}
|
||||||
Err(e @ LinkError::IoError(_)) => {
|
Err(e @ LinkError::IoError(_)) => sp.stop_and_persist(
|
||||||
sp.stop_and_persist(failure_str(), format!("{e}"))
|
failure_str(),
|
||||||
}
|
format!("{}: {op}, {e}", link.name),
|
||||||
|
),
|
||||||
Err(e) => sp.stop_and_persist(failure_str(), format!("{e}")),
|
Err(e) => sp.stop_and_persist(failure_str(), format!("{e}")),
|
||||||
_ => sp.stop_and_persist(
|
_ => sp.stop_and_persist(
|
||||||
failure_str(),
|
failure_str(),
|
||||||
|
|
Loading…
Reference in a new issue