diff --git a/src/cook/fetch.rs b/src/cook/fetch.rs index 9c4e3efa41..93ec3dd189 100644 --- a/src/cook/fetch.rs +++ b/src/cook/fetch.rs @@ -354,10 +354,23 @@ pub fn fetch_offline(recipe: &CookRecipe, logger: &PtyOut) -> Result { - redbear_ensure_offline_source(recipe_dir, &source_dir, logger)?; - let ident = fetch_apply_source_info(recipe, "".to_string())?; - FetchResult::cached(source_dir, ident) + Some(SourceRecipe::Path { path }) => { + let path = recipe_dir.join(path); + let cached = source_dir.is_dir() && modified_dir(&path)? <= modified_dir(&source_dir)?; + if !cached { + log_to_pty!( + logger, + "[DEBUG]: {:?} is newer than {:?}", + path.display(), + source_dir.display() + ); + copy_dir_all(&path, &source_dir).map_err(wrap_io_err!( + &path, + source_dir, + "Copying source" + ))?; + } + FetchResult::new(source_dir, "local_source".to_string(), cached) } None => { let ident = fetch_apply_source_info(recipe, "".to_string())?;