Skip to content

Commit

Permalink
Fix returned archive name, actually return assets in build results
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Detjens <[email protected]>
  • Loading branch information
detjensrobert committed Feb 8, 2025
1 parent 61c413f commit c532d00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/builder/artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ async fn extract_rename(
async fn extract_archive(
chal: &ChallengeConfig,
container: &docker::ContainerInfo,
// files: &Vec<PathBuf>,
files: &[PathBuf],
archive_name: &Path,
) -> Result<Vec<PathBuf>> {
Expand All @@ -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`
Expand Down
8 changes: 6 additions & 2 deletions src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
Expand Down

0 comments on commit c532d00

Please sign in to comment.