Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,22 @@ fn main() -> anyhow::Result<()> {
anyhow::bail!("Error occurred");
}
} else if argstruct.remove.is_some() {
let working_profile = get_installed_profile(&data_obj, profile_name);
if working_profile.is_none() {
if let Some(working_profile) = &get_installed_profile(&data_obj, profile_name) {
if !perform_transaction(
&mut data_obj,
&argstruct,
working_profile,
Transaction::Remove,
argstruct.force,
) {
anyhow::bail!("Error occurred");
}
} else {
console_writer::print_error_msg!(
"profile-not-installed",
profile_name = profile_name
);
anyhow::bail!("Error occurred");
} else if !perform_transaction(
&mut data_obj,
&argstruct,
working_profile.as_ref().unwrap(),
Transaction::Remove,
argstruct.force,
) {
anyhow::bail!("Error occurred");
}
}
}
Expand Down
Loading