Skip to content

Commit b8b688f

Browse files
committed
fix: respect --release when running cargo all
1 parent 8b6ec2b commit b8b688f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ fn main() {
1010
.map(|day| {
1111
let day = format!("{:02}", day);
1212

13-
let cmd = Command::new("cargo")
14-
.args(["run", "--release", "--bin", &day])
15-
.output()
16-
.unwrap();
13+
let mut args = vec!["run", "--bin", &day];
14+
if cfg!(not(debug_assertions)) {
15+
args.push("--release");
16+
}
17+
18+
let cmd = Command::new("cargo").args(&args).output().unwrap();
1719

1820
println!("----------");
1921
println!("{}| Day {} |{}", ANSI_BOLD, day, ANSI_RESET);

0 commit comments

Comments
 (0)