From 55b36e06efde6e5dc1c78bcd6a59ec6a4472c4e4 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sun, 4 Feb 2024 05:28:33 -0800 Subject: [PATCH] fix(scheduler): ensure repositories exists before iterating through it (#1375) --- crates/tabby-scheduler/src/repository.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/tabby-scheduler/src/repository.rs b/crates/tabby-scheduler/src/repository.rs index a1040c6f52ef..2d6229928c23 100644 --- a/crates/tabby-scheduler/src/repository.rs +++ b/crates/tabby-scheduler/src/repository.rs @@ -40,6 +40,9 @@ impl RepositoryExt for RepositoryConfig { } pub fn sync_repositories(repositories: &[RepositoryConfig]) -> Result<()> { + // Ensure repositories_dir exist. + std::fs::create_dir_all(repositories_dir())?; + let mut names = HashSet::new(); for repository in repositories { names.insert(repository.name());