From b9ec1206333e0995f38e947ee06707d5407893e6 Mon Sep 17 00:00:00 2001 From: Jeffrey Macko Date: Tue, 14 May 2024 12:25:49 +0200 Subject: [PATCH] make it code from docc folder --- Sources/PackageGeneratorCLI/cli.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/PackageGeneratorCLI/cli.swift b/Sources/PackageGeneratorCLI/cli.swift index ac2075a..bfe2fc1 100644 --- a/Sources/PackageGeneratorCLI/cli.swift +++ b/Sources/PackageGeneratorCLI/cli.swift @@ -94,7 +94,9 @@ struct PackageGeneratorCLI: AsyncParsableCommand { } func getImportsFromFile(_ file: File) -> [String] { - if file.extension != "swift" { return [] } + guard file.extension == "swift" else { return [] } + guard !file.url.path.contains("docc") else { return [] } + do { let source = try String(contentsOf: file.url, encoding: .utf8) let sourceFile = Parser.parse(source: source)