Skip to content

Commit 1401a6d

Browse files
committed
Fix that the project can't build without the submodule
1 parent fe0eee6 commit 1401a6d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Core/Package.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ let package = Package(
269269
name: "PlusFeatureFlag",
270270
dependencies: [
271271
].pro([
272-
"LicenseManagement"
272+
"LicenseManagement",
273273
])
274274
),
275275

@@ -398,10 +398,18 @@ import Foundation
398398

399399
func isProIncluded(file: StaticString = #file) -> Bool {
400400
let filePath = "\(file)"
401-
let url = URL(fileURLWithPath: filePath)
401+
let fileURL = URL(fileURLWithPath: filePath)
402+
let rootURL = fileURL
402403
.deletingLastPathComponent()
403404
.deletingLastPathComponent()
404-
.appendingPathComponent("Pro/Package.swift")
405-
return FileManager.default.fileExists(atPath: url.path)
405+
let folderURL = rootURL.appendingPathComponent("Pro")
406+
if !FileManager.default.fileExists(atPath: folderURL.path) {
407+
return false
408+
}
409+
let packageManifestURL = folderURL.appendingPathComponent("Package.swift")
410+
if !FileManager.default.fileExists(atPath: packageManifestURL.path) {
411+
return false
412+
}
413+
return true
406414
}
407415

0 commit comments

Comments
 (0)