Skip to content

Commit 23df82a

Browse files
committed
Add initializer that takes an AbsolutePath parameter
1 parent b33a963 commit 23df82a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/PackageModel/PackageIdentity.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ public struct PackageIdentity: Hashable, CustomStringConvertible {
4141
public init(_ url: String) {
4242
self.description = Self.provider.init(url).description
4343
}
44+
45+
/// Creates a package identity from a file path.
46+
/// - Parameter path: An absolute path to the package.
47+
public init(_ path: AbsolutePath) {
48+
self.init(path.pathString)
49+
}
4450
}
4551

4652
extension PackageIdentity: Comparable {

0 commit comments

Comments
 (0)