Added extra flag functionality

main
Michal S 2 years ago
parent 263237f556
commit a49f106a71

@ -39,14 +39,26 @@ pub fn build(pkg: &str, sign: bool, verbose: bool) -> i32 {
return 63; return 63;
} }
// Build each package // Parse extra flags from envvar
let a = Command::new("makepkg") let extra_flags = env::var("MAKEPKG_FLAGS").unwrap_or_else(|_| "".to_string());
.args(&[ let extra_flags = extra_flags.split(' ').collect::<Vec<&str>>();
// Default set of flags
let default_args = vec![
"-sf", "-sf",
"--skippgpcheck", "--skippgpcheck",
if sign { "--sign" } else { "--nosign" }, if sign { "--sign" } else { "--nosign" },
"--noconfirm", "--noconfirm",
]) ];
// Build each package
let a = Command::new("makepkg")
.args(
default_args
.iter()
.chain(extra_flags.iter())
.map(std::string::ToString::to_string),
)
.spawn() .spawn()
.unwrap() .unwrap()
.wait() .wait()

Loading…
Cancel
Save