From b8b688f9d86e496ab15d508ca3c80c1c770f9a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sp=C3=B6ttel?= <1682504+fspoettel@users.noreply.github.com> Date: Sun, 4 Dec 2022 11:56:41 +0100 Subject: [PATCH] fix: respect `--release` when running `cargo all` --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 45701ab..95c690f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);