Skip to content

Commit 2cc19dd

Browse files
committed
Check for existence of src dir
1 parent 9d6eb22 commit 2cc19dd

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

tmc-langs/src/submission_packaging.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,26 @@ pub fn prepare_submission(
270270
}
271271

272272
log::debug!("copying csproj files in clone/*/src");
273-
for entry in WalkDir::new(clone_path.join("src"))
274-
.min_depth(2)
275-
.max_depth(2)
276-
{
277-
let entry = entry?;
278-
if entry.path().is_file()
279-
&& entry
280-
.path()
281-
.extension()
282-
.map(|ext| ext == "csproj")
283-
.unwrap_or_default()
273+
let clone_src = clone_path.join("src");
274+
if clone_src.exists() {
275+
for entry in WalkDir::new(clone_path.join("src"))
276+
.min_depth(2)
277+
.max_depth(2)
284278
{
285-
let relative = entry
286-
.path()
287-
.strip_prefix(&clone_path)
288-
.expect("always inside clone root");
289-
file_util::copy(entry.path(), dest.join(relative))?;
279+
let entry = entry?;
280+
if entry.path().is_file()
281+
&& entry
282+
.path()
283+
.extension()
284+
.map(|ext| ext == "csproj")
285+
.unwrap_or_default()
286+
{
287+
let relative = entry
288+
.path()
289+
.strip_prefix(&clone_path)
290+
.expect("always inside clone root");
291+
file_util::copy(entry.path(), dest.join(relative))?;
292+
}
290293
}
291294
}
292295

0 commit comments

Comments
 (0)