[skip ci]
This commit is contained in:
Max Howell
2019-01-28 16:05:39 +00:00
parent 2394cc1c85
commit ee1f46954c
2 changed files with 3 additions and 3 deletions

View File

@@ -220,7 +220,7 @@ package.append(.package(url: "https://github.com/mxcl/Path.swift", from: "0.5.0"
CocoaPods: CocoaPods:
```ruby ```ruby
pod 'Path.swift' ~> '0.5.0' pod 'Path.swift', '~> 0.5'
``` ```
Carthage: Carthage:

View File

@@ -36,7 +36,7 @@ public struct Path: Equatable, Hashable, Comparable {
self.string = string self.string = string
} }
/// Returns `nil` unless fed an absolute path /// Returns `nil` unless fed an absolute path.
public init?(_ description: String) { public init?(_ description: String) {
guard description.starts(with: "/") || description.starts(with: "~/") else { return nil } guard description.starts(with: "/") || description.starts(with: "~/") else { return nil }
self.init(string: (description as NSString).standardizingPath) self.init(string: (description as NSString).standardizingPath)
@@ -91,7 +91,7 @@ public struct Path: Equatable, Hashable, Comparable {
- Parameter pathComponent: The string to join with this path. - Parameter pathComponent: The string to join with this path.
- Returns: A new joined path. - Returns: A new joined path.
- SeeAlso: `Path./(_:, _:)` - SeeAlso: `Path./(_:_:)`
*/ */
public func join<S>(_ pathComponent: S) -> Path where S: StringProtocol { public func join<S>(_ pathComponent: S) -> Path where S: StringProtocol {
//TODO standardizingPath does more than we want really (eg tilde expansion) //TODO standardizingPath does more than we want really (eg tilde expansion)