summaryrefslogtreecommitdiff
path: root/src/packages/pacman.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/packages/pacman.rs')
-rw-r--r--src/packages/pacman.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/packages/pacman.rs b/src/packages/pacman.rs
index b5be4c0..e10c6fb 100644
--- a/src/packages/pacman.rs
+++ b/src/packages/pacman.rs
@@ -1,4 +1,4 @@
1use std::process::Command; 1use std::process::{Command, Stdio};
2 2
3use super::{Package, PackageManager}; 3use super::{Package, PackageManager};
4 4
@@ -34,13 +34,23 @@ impl PackageManager for Pacman {
34 id: split[0].to_string(), 34 id: split[0].to_string(),
35 version: split[1].to_string(), 35 version: split[1].to_string(),
36 explicit, 36 explicit,
37 }) 37 });
38 } 38 }
39 39
40 Ok(pkgs) 40 Ok(pkgs)
41 } 41 }
42 42
43 fn install(&self, _pkgs: Vec<super::Package>) { 43 fn install(&self, pkgs: Vec<super::Package>) -> Result<()> {
44 todo!(); 44 let mut args = vec!["--noconfirm".to_string(), "-S".to_string()];
45
46 for pkg in pkgs {
47 args.push(pkg.id);
48 }
49 Command::new("pacman")
50 .stdout(Stdio::inherit())
51 .args(args)
52 .spawn()?
53 .wait_with_output()?;
54 Ok(())
45 } 55 }
46} 56}