From c23bdd5bb92b149464e4b39ae7ad586cc8ee33da Mon Sep 17 00:00:00 2001 From: Amy Date: Wed, 3 Nov 2021 19:36:00 +0100 Subject: [PATCH] forgot to remove commented codeblock --- src/mods/inssort.rs | 1 - src/mods/install.rs | 58 +-------------------------------------------- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/src/mods/inssort.rs b/src/mods/inssort.rs index 021d321..c46d483 100644 --- a/src/mods/inssort.rs +++ b/src/mods/inssort.rs @@ -91,7 +91,6 @@ pub fn inssort(noconfirm: bool, as_dep: bool, pkgs: Vec) { } } -//this function is used to install packages from a file pub fn inssort_from_file(noconfirm: bool, as_dep: bool, file: &str) { let mut pkgs: Vec = Vec::new(); let mut contents = String::new(); diff --git a/src/mods/install.rs b/src/mods/install.rs index eb5ad83..ac2bdfb 100644 --- a/src/mods/install.rs +++ b/src/mods/install.rs @@ -46,60 +46,4 @@ pub fn install(noconfirm: bool, as_dep: bool, pkg: &str) { None => err_unrec(format!("Couldn't install packages: {}", pkg)), }; } -} - -/* -//this function is used to install packages from a file -pub fn install_from_file(noconfirm: bool, as_dep: bool, file: &str) { - let mut pkgs: Vec<&str> = Vec::new(); - // let mut file = File::open(file).expect("Couldn't open file"); - let mut contents = String::new(); - contents = std::fs::read_to_string(&file).expect("Couldn't read file"); - for line in contents.lines() { - println!("{}", line); - pkgs.push(line); - } - if as_dep == false { - if noconfirm == true { - let result = Command::new("pacman") - .arg("-S") - .arg("--noconfirm") - .arg("--needed") - .args(&pkgs) - .status() - .expect("Couldn't call pacman"); - match result.code() { - Some(0) => succ(format!("Succesfully installed packages: {}", contents)), - Some(_) => err_unrec(format!("Couldn't install packages: {}", contents)), - None => err_unrec(format!("Couldn't install packages: {}", contents)), - }; - } else { - let result = Command::new("pacman") - .arg("-S") - .arg("--needed") - .args(&pkgs) - .status() - .expect("Couldn't call pacman"); - match result.code() { - Some(0) => succ(format!("Succesfully installed packages: {}", contents)), - Some(_) => err_unrec(format!("Couldn't install packages: {}", contents)), - None => err_unrec(format!("Couldn't install packages: {}", contents)), - }; - } - } else { - let result = Command::new("pacman") - .arg("-S") - .arg("--noconfirm") - .arg("--needed") - .arg("--asdeps") - .args(&pkgs) - .status() - .expect("Couldn't call pacman"); - match result.code() { - Some(0) => succ(format!("Succesfully installed packages: {}", contents)), - Some(_) => err_unrec(format!("Couldn't install packages: {}", contents)), - None => err_unrec(format!("Couldn't install packages: {}", contents)), - }; - } -} -*/ \ No newline at end of file +} \ No newline at end of file