pull: fix error message when directory already exists
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user