diff --git a/src/clone.rs b/src/clone.rs index b7c0b6d..e8c0e31 100644 --- a/src/clone.rs +++ b/src/clone.rs @@ -1,5 +1,5 @@ use git2::Repository; -use std::{fs, env, path::Path, process::Command}; +use std::{fs, path::Path, process::Command}; pub fn clone(pkg: &str) { let cachedir = format!("{}/.cache/ame/{}", std::env::var("HOME").unwrap(), pkg); @@ -15,11 +15,11 @@ pub fn clone(pkg: &str) { println!("Cloning {} ...", pkg); Repository::clone(&url, &path).unwrap(); println!("Installing {} ...", pkg); - env::set_current_dir(&cachedir).expect(&error); Command::new("makepkg") + .current_dir(&cachedir) .arg("--noconfirm") .arg("-si") - .spawn() + .output() .expect(&error); } } diff --git a/src/uninstall.rs b/src/uninstall.rs index de2a2d8..796456b 100644 --- a/src/uninstall.rs +++ b/src/uninstall.rs @@ -5,6 +5,7 @@ pub fn uninstall(pkg: &str) { Command::new("sudo") .arg("pacman") .arg("-R") + .arg("--noconfirm") .arg(&pkg) .spawn() //.status() TODO: for some reason cant use both .spawn and .status at the same time, need fix