aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command')
-rw-r--r--crates/shirabe/src/command/create_project_command.rs6
-rw-r--r--crates/shirabe/src/command/reinstall_command.rs43
2 files changed, 21 insertions, 28 deletions
diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs
index 7312a60b..a907bc09 100644
--- a/crates/shirabe/src/command/create_project_command.rs
+++ b/crates/shirabe/src/command/create_project_command.rs
@@ -1011,9 +1011,11 @@ impl CreateProjectCommand {
let mut im = installation_manager.borrow_mut();
im.set_output_progress(!no_progress);
im.add_installer(Box::new(project_installer));
- let mut installed_repo = InstalledArrayRepository::new()?;
+ let installed_repo = crate::repository::InstalledRepositoryInterfaceHandle::new(
+ InstalledArrayRepository::new()?,
+ );
im.execute(
- &mut installed_repo,
+ &installed_repo,
vec![InstallOperation::new(package.clone()).into()],
true,
true,
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()