From 4493fcb0a84300fc3528afa96b5b24cbffa5d794 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 17 Nov 2025 07:11:58 +0700 Subject: [PATCH] Run cargo fetch on fetch --- src/cook/fetch.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/cook/fetch.rs b/src/cook/fetch.rs index eca04b0c..33d02bbe 100644 --- a/src/cook/fetch.rs +++ b/src/cook/fetch.rs @@ -306,6 +306,14 @@ pub fn fetch(recipe_dir: &Path, recipe: &Recipe, logger: &PtyOut) -> Result, + logger: &PtyOut, +) -> Result<(), String> { + let mut target_dir = recipe_dir.clone(); + if let Some(package_path) = package_path { + target_dir = target_dir.join(package_path); + } + + let mut command = if is_redox() { + Command::new("cargo") + } else { + let cookbook_redoxer = Path::new("target/release/cookbook_redoxer") + .canonicalize() + .unwrap_or(PathBuf::from("/bin/false")); + Command::new(&cookbook_redoxer) + }; + command.arg("fetch"); + command.arg("--manifest-path"); + command.arg(target_dir.join("Cargo.toml").into_os_string()); + run_command(command, logger)?; + Ok(()) +} + pub(crate) fn fetch_is_patches_newer( recipe_dir: &Path, patches: &Vec,