Check that library is file

This commit is contained in:
Steven Tang 2022-11-20 10:44:16 +11:00
parent 40b7e0e525
commit a1ea1c128d
No known key found for this signature in database
GPG Key ID: 1597520C734BAE66

View File

@ -707,6 +707,12 @@ impl<'a> CrateLocator<'a> {
loc.original().clone(),
));
}
if !loc.original().is_file() {
return Err(CrateError::ExternLocationNotFile(
self.crate_name,
loc.original().clone(),
));
}
let Some(file) = loc.original().file_name().and_then(|s| s.to_str()) else {
return Err(CrateError::ExternLocationNotFile(
self.crate_name,