Skip to content

Commit 701af61

Browse files
committed
Fix returned archive name, actually return assets in build results
Signed-off-by: Robert Detjens <[email protected]>
1 parent f968aa2 commit 701af61

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/builder/artifacts.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ async fn extract_rename(
176176
async fn extract_archive(
177177
chal: &ChallengeConfig,
178178
container: &docker::ContainerInfo,
179-
// files: &Vec<PathBuf>,
180179
files: &[PathBuf],
181180
archive_name: &Path,
182181
) -> Result<Vec<PathBuf>> {
@@ -203,7 +202,7 @@ async fn extract_archive(
203202
// archive_name already has the chal dir prepended
204203
zip_files(archive_name, &copied_files)?;
205204

206-
Ok(vec![chal.directory.join(archive_name)])
205+
Ok(vec![archive_name.to_path_buf()])
207206
}
208207

209208
/// Add multiple local `files` to a zipfile at `zip_name`

src/builder/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async fn build_challenge(
138138

139139
// extract each challenge provide entry
140140
// this handles both local files and from build containers
141-
let extracted_files = chal
141+
built.assets = chal
142142
.provide
143143
.iter()
144144
.map(|p| async {
@@ -152,7 +152,11 @@ async fn build_challenge(
152152
})
153153
})
154154
.try_join_all()
155-
.await?;
155+
.await?
156+
// flatten to single vec of all paths
157+
.into_iter()
158+
.flatten()
159+
.collect_vec();
156160

157161
info!("extracted artifacts: {:?}", built.assets);
158162
}

0 commit comments

Comments
 (0)