Entry.files defaults to all files

This commit is contained in:
Max Howell
2019-01-28 11:42:23 -05:00
parent ee1f46954c
commit 19c0c19bb6
5 changed files with 43 additions and 11 deletions

View File

@@ -73,10 +73,15 @@ public struct Path: Equatable, Hashable, Comparable {
/**
Returns the filename extension of this path.
- Remark: Implemented via `NSString.pathExtension`.
- Note: We special case eg. `foo.tar.gz`.
*/
@inlinable
public var `extension`: String {
return (string as NSString).pathExtension
if string.hasSuffix(".tar.gz") {
return "tar.gz"
} else {
return (string as NSString).pathExtension
}
}
//MARK: Pathing