fixing stuff up

i18n
jnats 3 years ago
parent 8633544015
commit 85c02b91af

@ -1,5 +1,5 @@
use git2::Repository; use git2::Repository;
use std::{fs, env, path::Path, process::Command}; use std::{fs, path::Path, process::Command};
pub fn clone(pkg: &str) { pub fn clone(pkg: &str) {
let cachedir = format!("{}/.cache/ame/{}", std::env::var("HOME").unwrap(), pkg); let cachedir = format!("{}/.cache/ame/{}", std::env::var("HOME").unwrap(), pkg);
@ -15,11 +15,11 @@ pub fn clone(pkg: &str) {
println!("Cloning {} ...", pkg); println!("Cloning {} ...", pkg);
Repository::clone(&url, &path).unwrap(); Repository::clone(&url, &path).unwrap();
println!("Installing {} ...", pkg); println!("Installing {} ...", pkg);
env::set_current_dir(&cachedir).expect(&error);
Command::new("makepkg") Command::new("makepkg")
.current_dir(&cachedir)
.arg("--noconfirm") .arg("--noconfirm")
.arg("-si") .arg("-si")
.spawn() .output()
.expect(&error); .expect(&error);
} }
} }

@ -5,6 +5,7 @@ pub fn uninstall(pkg: &str) {
Command::new("sudo") Command::new("sudo")
.arg("pacman") .arg("pacman")
.arg("-R") .arg("-R")
.arg("--noconfirm")
.arg(&pkg) .arg(&pkg)
.spawn() .spawn()
//.status() TODO: for some reason cant use both .spawn and .status at the same time, need fix //.status() TODO: for some reason cant use both .spawn and .status at the same time, need fix

Loading…
Cancel
Save