diff --git a/src/pull.rs b/src/pull.rs index adef83f..b8650e4 100644 --- a/src/pull.rs +++ b/src/pull.rs @@ -573,6 +573,14 @@ pub async fn pull( Path::new(package).to_path_buf() }; + if package_dir.exists() { + return Err(format!( + "Directory '{}' already exists. Remove it first, or change working directory.", + package_dir.display() + ) + .into()); + } + /* Fetch the package: either via git (preferred VCS) or the archive */ if let Some(ref url) = package_info.preferred_vcs && !force_archive