Skip to content

Commit 132fb66

Browse files
fix: compatibility with aoc-cli^0.4.0 (#7)
Co-authored-by: Peter Anning <22272449+peteanning@users.noreply.github.com>
1 parent 840d617 commit 132fb66

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/bin/download.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,22 @@ fn main() {
5656
exit_with_status(1, &tmp_file_path);
5757
}
5858

59-
println!("Downloading input via aoc-cli...");
59+
let mut cmd_args = vec![];
6060

61-
let mut cmd_args = vec![
62-
"download".into(),
61+
if let Some(year) = args.year {
62+
cmd_args.push("--year".into());
63+
cmd_args.push(year.to_string());
64+
}
65+
66+
cmd_args.append(&mut vec![
6367
"--file".into(),
6468
tmp_file_path.to_string_lossy().to_string(),
6569
"--day".into(),
6670
args.day.to_string(),
67-
];
71+
"download".into(),
72+
]);
6873

69-
if let Some(year) = args.year {
70-
cmd_args.push("--year".into());
71-
cmd_args.push(year.to_string());
72-
}
74+
println!("Downloading input with >aoc {}", cmd_args.join(" "));
7375

7476
match Command::new("aoc").args(cmd_args).output() {
7577
Ok(cmd_output) => {

0 commit comments

Comments
 (0)