From 3dcf5ff27e6c161bf13576a2c0c8192d2139e7bf Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 12:54:46 +0900 Subject: [PATCH] fix with new URL initializer --- .../InlineDependenciesFinder.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift b/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift index c537bbfb..9c721fc9 100644 --- a/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift +++ b/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift @@ -29,7 +29,15 @@ struct InlineDependenciesFinder { .trimmingCharacters(in: .whitespaces) .components(separatedBy: " " + config.majorVersionPrefix) - guard let url = URL(string: splittedImportString[0]) else { + let url: URL? = { + #if os(macOS) && compiler(>=5.9) + if #available(macOS 14.0, *) { + return URL(string: splittedImportString[0], encodingInvalidCharacters: false) + } + #endif + return URL(string: splittedImportString[0]) + }() + guard let url = url else { throw Errors.invalidInlineDependencyURL(splittedImportString[0]) }