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,