From aefa7a3f4fd175fdee7594ca68fa9fe888aaa0c7 Mon Sep 17 00:00:00 2001 From: Jarrett Tierney Date: Wed, 30 Oct 2024 19:59:24 +0000 Subject: [PATCH] fix bug where twoliter requires sources directory to always exist --- twoliter/src/project/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twoliter/src/project/mod.rs b/twoliter/src/project/mod.rs index 635341b7..8fe87f5f 100644 --- a/twoliter/src/project/mod.rs +++ b/twoliter/src/project/mod.rs @@ -228,6 +228,9 @@ impl Project { /// files. pub(crate) async fn find_go_modules(&self) -> Result> { let root = self.project_dir.join("sources"); + if !root.exists() { + return Ok(Vec::new()); + } let mut entries = WalkDir::new(&root); let mut modules = Vec::new(); loop {