From 1cd77984d415b9db087759a9c9135f43630e043d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 14:32:25 -0700 Subject: [PATCH] wait for downloads before exiting --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e7b88d0..4b1d116 100644 --- a/src/main.rs +++ b/src/main.rs @@ -181,12 +181,16 @@ fn download(map_list: Vec) -> BoxResult<()>{ header.as_str(), "-O", ]; - for map_id in map_list.iter() { + let processes_result:Result, _>=map_list.iter().map(|map_id|{ std::process::Command::new("wget") .args(shared_args) .arg(format!("maps/unprocessed/{}.rbxm",map_id)) .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) - .spawn()?; + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for mut child in processes_result?{ + child.wait()?; } Ok(()) }