aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/reinstall_command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command/reinstall_command.rs')
-rw-r--r--crates/shirabe/src/command/reinstall_command.rs43
1 files changed, 17 insertions, 26 deletions
diff --git a/crates/shirabe/src/command/reinstall_command.rs b/crates/shirabe/src/command/reinstall_command.rs
index 95fde5ae..0d3567a2 100644
--- a/crates/shirabe/src/command/reinstall_command.rs
+++ b/crates/shirabe/src/command/reinstall_command.rs
@@ -244,32 +244,23 @@ impl Command for ReinstallCommand {
let uninstall_operations: Vec<AnyOperation> =
uninstall_operations.into_iter().map(Into::into).collect();
- {
- let mut local_repo_ref = local_repo.borrow_mut();
- let repo = local_repo_ref
- .as_installed_repository_interface_mut()
- .expect("local repository must be an InstalledRepositoryInterface");
- installation_manager.borrow_mut().execute(
- repo,
- uninstall_operations,
- dev_mode,
- true,
- false,
- )?;
- }
- {
- let mut local_repo_ref = local_repo.borrow_mut();
- let repo = local_repo_ref
- .as_installed_repository_interface_mut()
- .expect("local repository must be an InstalledRepositoryInterface");
- installation_manager.borrow_mut().execute(
- repo,
- install_operations.clone(),
- dev_mode,
- true,
- false,
- )?;
- }
+ let repo = crate::repository::InstalledRepositoryInterfaceHandle::from_repository_handle(
+ &local_repo,
+ );
+ installation_manager.borrow_mut().execute(
+ &repo,
+ uninstall_operations,
+ dev_mode,
+ true,
+ false,
+ )?;
+ installation_manager.borrow_mut().execute(
+ &repo,
+ install_operations.clone(),
+ dev_mode,
+ true,
+ false,
+ )?;
if !input
.borrow()