Skip to content

Commit

Permalink
Minor style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Jun 6, 2021
1 parent 76ae479 commit 55565ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sources/TSCBasic/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public protocol Path: Hashable, Codable, CustomStringConvertible {
var components: [String] { get }
}

/// Default implementations of some protocol stubs.
extension Path {
public var pathString: String {
if filepath.string.isEmpty {
Expand Down Expand Up @@ -145,7 +146,10 @@ extension Path {
}
return components
}
}

/// Default implementation of `CustomStringConvertible`.
extension Path {
public var description: String {
return pathString
}
Expand All @@ -156,6 +160,7 @@ extension Path {
}
}

/// Default implementation of `Codable`.
extension Path {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
Expand Down Expand Up @@ -265,9 +270,7 @@ public struct AbsolutePath: Path {
return AbsolutePath(filepath)
}

/// Root directory (whose string representation is just a path separator).
///
/// FIXME: root is not a static value, we'd better remove this property.
/// The root directory. It is always `/` on UNIX, but may vary on Windows.
@available(*, deprecated, message: "root is not a static value, use the instance property instead")
public static var root: AbsolutePath {
if let rootPath = localFileSystem.currentWorkingDirectory?.root {
Expand Down

0 comments on commit 55565ba

Please sign in to comment.