Prepare 1.0.0 release
This commit is contained in:
@@ -29,7 +29,7 @@ public extension Pathish {
|
||||
if overwrite, let tokind = to.type, tokind != .directory, type != .directory {
|
||||
try FileManager.default.removeItem(at: to.url)
|
||||
}
|
||||
#if os(Linux) && !swift(>=5.2) // check if fixed
|
||||
#if os(Linux) && !swift(>=5.3) // check if fixed
|
||||
if !overwrite, to.type != nil {
|
||||
throw CocoaError.error(.fileWriteFileExists)
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public extension Pathish {
|
||||
if overwrite, let kind = rv.type, kind != .directory {
|
||||
try FileManager.default.removeItem(at: rv.url)
|
||||
}
|
||||
#if os(Linux) && !swift(>=5.2) // check if fixed
|
||||
#if os(Linux) && !swift(>=5.3) // check if fixed
|
||||
if !overwrite, rv.type != nil {
|
||||
throw CocoaError.error(.fileWriteFileExists)
|
||||
}
|
||||
@@ -204,7 +204,7 @@ public extension Pathish {
|
||||
}
|
||||
|
||||
/**
|
||||
Renames the file at path.
|
||||
Renames the file (basename only) at path.
|
||||
|
||||
Path.root.foo.bar.rename(to: "baz") // => /foo/baz
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ public extension Pathish {
|
||||
|
||||
/**
|
||||
- Returns: `true` if the path represents an actual filesystem entry.
|
||||
- Note: If `self` is a symlink the return value represents the destination.
|
||||
- Note: If `self` is a symlink the return value represents the destination, thus if the destination doesn’t exist this returns `false` even if the symlink exists.
|
||||
- Note: To determine if a symlink exists, use `.type`.
|
||||
*/
|
||||
var exists: Bool {
|
||||
return FileManager.default.fileExists(atPath: string)
|
||||
|
||||
@@ -176,7 +176,7 @@ public extension Pathish {
|
||||
Returns the filename extension of this path.
|
||||
- Remark: If there is no extension returns "".
|
||||
- Remark: If the filename ends with any number of ".", returns "".
|
||||
- Note: We special case eg. `foo.tar.gz`.
|
||||
- Note: We special case eg. `foo.tar.gz`—there are a limited number of these specializations, feel free to PR more.
|
||||
*/
|
||||
@inlinable
|
||||
var `extension`: String {
|
||||
|
||||
Reference in New Issue
Block a user