fix: compatibility with aoc-cli^0.4.0 (#7)

Co-authored-by: Peter Anning <22272449+peteanning@users.noreply.github.com>
This commit is contained in:
Felix Spöttel 2022-11-06 21:23:46 +01:00 committed by GitHub
parent 840d617dde
commit 132fb662de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -56,21 +56,23 @@ fn main() {
exit_with_status(1, &tmp_file_path);
}
println!("Downloading input via aoc-cli...");
let mut cmd_args = vec![
"download".into(),
"--file".into(),
tmp_file_path.to_string_lossy().to_string(),
"--day".into(),
args.day.to_string(),
];
let mut cmd_args = vec![];
if let Some(year) = args.year {
cmd_args.push("--year".into());
cmd_args.push(year.to_string());
}
cmd_args.append(&mut vec![
"--file".into(),
tmp_file_path.to_string_lossy().to_string(),
"--day".into(),
args.day.to_string(),
"download".into(),
]);
println!("Downloading input with >aoc {}", cmd_args.join(" "));
match Command::new("aoc").args(cmd_args).output() {
Ok(cmd_output) => {
io::stdout()