diff --git a/src/builder/artifacts.rs b/src/builder/artifacts.rs index 5c37656..24b046c 100644 --- a/src/builder/artifacts.rs +++ b/src/builder/artifacts.rs @@ -176,7 +176,6 @@ async fn extract_rename( async fn extract_archive( chal: &ChallengeConfig, container: &docker::ContainerInfo, - // files: &Vec, files: &[PathBuf], archive_name: &Path, ) -> Result> { @@ -203,7 +202,7 @@ async fn extract_archive( // archive_name already has the chal dir prepended zip_files(archive_name, &copied_files)?; - Ok(vec![chal.directory.join(archive_name)]) + Ok(vec![archive_name.to_path_buf()]) } /// Add multiple local `files` to a zipfile at `zip_name` diff --git a/src/builder/mod.rs b/src/builder/mod.rs index 93ea5a8..1245905 100644 --- a/src/builder/mod.rs +++ b/src/builder/mod.rs @@ -138,7 +138,7 @@ async fn build_challenge( // extract each challenge provide entry // this handles both local files and from build containers - let extracted_files = chal + built.assets = chal .provide .iter() .map(|p| async { @@ -152,7 +152,11 @@ async fn build_challenge( }) }) .try_join_all() - .await?; + .await? + // flatten to single vec of all paths + .into_iter() + .flatten() + .collect_vec(); info!("extracted artifacts: {:?}", built.assets); }