Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Fix crash #78 #79

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Sources/swift-doc/Subcommands/Generate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ extension SwiftDoc {
pages["Home"] = HomePage(module: module)
}

try pages.map { $0 }.parallelForEach {
for (name, page) in pages {
let filename: String
switch format {
case .commonmark:
filename = "\($0.key).md"
case .html where $0.key == "Home":
filename = "\(name).md"
case .html where name == "Home":
filename = "index.html"
case .html:
filename = "\($0.key)/index.html"
filename = "\(name)/index.html"
}

let url = outputDirectoryURL.appendingPathComponent(filename)
try $0.value.write(to: url, format: format, baseURL: options.baseURL)
try page.write(to: url, format: format, baseURL: options.baseURL)
}
}
} catch {
Expand Down