fix(cook/fetch): check if directory does not exist

Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
Anhad Singh 2025-02-02 13:58:24 +11:00
parent 9b1e5834ae
commit 330ad13e28
No known key found for this signature in database
GPG Key ID: 80E0357347554B89

View File

@ -228,7 +228,7 @@ fn fetch(recipe_dir: &Path, source: &Option<SourceRecipe>) -> Result<PathBuf, St
}
}
Some(SourceRecipe::Path { path }) => {
if modified_dir(Path::new(path))? > modified_dir(&source_dir)? {
if !source_dir.is_dir() || modified_dir(Path::new(path))? > modified_dir(&source_dir)? {
eprintln!("[DEBUG]: {} is newer than {}", path, source_dir.display());
copy_dir_all(path, &source_dir).map_err(|e| {
format!(