forgot to remove commented codeblock

i18n
Amy 3 years ago
parent e8b05e2a89
commit c23bdd5bb9
No known key found for this signature in database
GPG Key ID: 6672E6DD65BEA50B

@ -91,7 +91,6 @@ pub fn inssort(noconfirm: bool, as_dep: bool, pkgs: Vec<String>) {
}
}
//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<String> = Vec::new();
let mut contents = String::new();

@ -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)),
};
}
}
*/
}
Loading…
Cancel
Save