Skip generating index if documentation doesnt exists (#3608)

This commit is contained in:
Dániel Buga 2025-06-09 12:01:15 +02:00 committed by GitHub
parent ac4bbdd6be
commit 77be40d2e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -326,6 +326,13 @@ pub fn build_documentation_index(workspace: &Path, packages: &mut [Package]) ->
// Each path we iterate over should be the directory for a given version of // Each path we iterate over should be the directory for a given version of
// the package's documentation: (except latest) // the package's documentation: (except latest)
if !package_docs_path.exists() {
log::warn!(
"Package documentation path does not exist: '{}', skipping",
package_docs_path.display()
);
continue;
}
for version_path in fs::read_dir(package_docs_path)? { for version_path in fs::read_dir(package_docs_path)? {
let version_path = version_path?.path(); let version_path = version_path?.path();
if version_path.is_file() { if version_path.is_file() {