Restructured the folder structure in the library and test targets.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
enum ResourceFile: String {
|
||||
case dockerIgnore = "docker_ignore"
|
||||
case gitIgnore = "git_ignore"
|
||||
case license
|
||||
case package
|
||||
case readme
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
extension ResourceFile {
|
||||
|
||||
// MARK: Computed
|
||||
|
||||
var fileName: String {
|
||||
switch self {
|
||||
case .dockerIgnore: return ".dockerignore"
|
||||
case .gitIgnore: return ".gitignore"
|
||||
case .license: return "LICENSE"
|
||||
case .readme: return "README.md"
|
||||
case .package: return "Package.swift"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - CaseIterable
|
||||
|
||||
extension ResourceFile: CaseIterable {}
|
||||
@@ -0,0 +1,5 @@
|
||||
import Foundation
|
||||
|
||||
// MARK: - BundleServicing
|
||||
|
||||
extension Bundle: BundleServicing {}
|
||||
@@ -0,0 +1,35 @@
|
||||
import Foundation
|
||||
|
||||
extension URL {
|
||||
|
||||
// MARK: Initialisers
|
||||
|
||||
init(at filePath: String) {
|
||||
if #available(macOS 13.0, *) {
|
||||
self = URL(filePath: filePath)
|
||||
} else {
|
||||
self = URL(fileURLWithPath: filePath)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Computed
|
||||
|
||||
var pathString: String {
|
||||
if #available(macOS 13.0, *) {
|
||||
path(percentEncoded: true)
|
||||
} else {
|
||||
path
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
func appendingPath(_ path: String) -> URL {
|
||||
if #available(macOS 13.0, *) {
|
||||
appending(path: path)
|
||||
} else {
|
||||
appendingPathComponent(path)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user