Skip to content

Commit f42610b

Browse files
Merge pull request #79 from bow-swift/fix-bug-carbon
fix bug to terminate carbon script
2 parents dab03f0 + 29d670b commit f42610b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

markdown/Carbon/main.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func main(downloader: CarbonDownloader) {
3434
/// - filePath: input page in Apple's playground format.
3535
/// - outputPath: output where to render the snippets.
3636
func renderCarbon(downloader: CarbonDownloader, from filePath: String, to outputPath: String, style: CarbonStyle) {
37+
defer { CarbonApplication.terminate() }
3738
guard let content = try? String(contentsOf: URL(fileURLWithPath: filePath), encoding: .utf8) else { Console.error(information: "").show(); return }
3839

3940
let carbonGenerator = CarbonGenerator(downloader: downloader, style: style, output: outputPath)
@@ -44,8 +45,6 @@ func renderCarbon(downloader: CarbonDownloader, from filePath: String, to output
4445
} else {
4546
Console.error(information: trace).show()
4647
}
47-
48-
CarbonApplication.terminate()
4948
}
5049

5150

0 commit comments

Comments
 (0)