wait for downloads before exiting

This commit is contained in:
Quaternions 2023-09-14 14:32:25 -07:00
parent b0fe231388
commit 1cd77984d4

View File

@ -181,12 +181,16 @@ fn download(map_list: Vec<u64>) -> BoxResult<()>{
header.as_str(),
"-O",
];
for map_id in map_list.iter() {
let processes_result:Result<Vec<_>, _>=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(())
}