chore: move files around
This commit is contained in:
17
src/Common/URL+File.swift
Normal file
17
src/Common/URL+File.swift
Normal file
@@ -0,0 +1,17 @@
|
||||
import Foundation
|
||||
|
||||
extension URL {
|
||||
/// Folder where user can mofifications to html template
|
||||
static let UserModDir: URL? =
|
||||
FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
|
||||
|
||||
/// Returns `true` if file or folder exists.
|
||||
@inlinable func exists() -> Bool {
|
||||
FileManager.default.fileExists(atPath: self.path)
|
||||
}
|
||||
|
||||
/// Returns URL by deleting last path component
|
||||
@inlinable func parentDir() -> URL {
|
||||
self.deletingLastPathComponent()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user