fix: respect --release when running cargo all

This commit is contained in:
Felix Spöttel 2022-12-04 11:56:41 +01:00
parent 8b6ec2b607
commit b8b688f9d8

View file

@ -10,10 +10,12 @@ fn main() {
.map(|day| {
let day = format!("{:02}", day);
let cmd = Command::new("cargo")
.args(["run", "--release", "--bin", &day])
.output()
.unwrap();
let mut args = vec!["run", "--bin", &day];
if cfg!(not(debug_assertions)) {
args.push("--release");
}
let cmd = Command::new("cargo").args(&args).output().unwrap();
println!("----------");
println!("{}| Day {} |{}", ANSI_BOLD, day, ANSI_RESET);