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;
} }
// Parse extra flags from envvar
let extra_flags = env::var("MAKEPKG_FLAGS").unwrap_or_else(|_| "".to_string());
let extra_flags = extra_flags.split(' ').collect::<Vec<&str>>();
// Default set of flags
let default_args = vec![
"-sf",
"--skippgpcheck",
if sign { "--sign" } else { "--nosign" },
"--noconfirm",
];
// Build each package // Build each package
let a = Command::new("makepkg") let a = Command::new("makepkg")
.args(&[ .args(
"-sf", default_args
"--skippgpcheck", .iter()
if sign { "--sign" } else { "--nosign" }, .chain(extra_flags.iter())
"--noconfirm", .map(std::string::ToString::to_string),
]) )
.spawn() .spawn()
.unwrap() .unwrap()
.wait() .wait()

Loading…
Cancel
Save