misc: move core to applicationSupport
This commit is contained in:
parent
8708774735
commit
a6be0498ee
|
@ -23,10 +23,11 @@ struct Paths {
|
||||||
}
|
}
|
||||||
|
|
||||||
static func defaultCorePath() -> String? {
|
static func defaultCorePath() -> String? {
|
||||||
guard var path = Bundle.main.resourcePath else {
|
let path = Paths
|
||||||
return nil
|
.applicationSupportDirectory()
|
||||||
}
|
.appendingPathComponent(".private_core")
|
||||||
path += "/\(kDefauleMetaCoreName)"
|
.appendingPathComponent(kDefauleMetaCoreName)
|
||||||
|
|
||||||
return FileManager.default.fileExists(atPath: path) ? path : nil
|
return FileManager.default.fileExists(atPath: path) ? path : nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,9 +39,14 @@ struct Paths {
|
||||||
}
|
}
|
||||||
|
|
||||||
static func alphaCorePath() -> URL? {
|
static func alphaCorePath() -> URL? {
|
||||||
FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)
|
Paths
|
||||||
.first?
|
.applicationSupportDirectory()
|
||||||
.appendingPathComponent("com.metacubex.ClashX.meta")
|
.appendingPathComponent(kDefauleMetaCoreName)
|
||||||
.appendingPathComponent(kDefauleMetaCoreName)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static func applicationSupportDirectory() -> URL? {
|
||||||
|
FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)
|
||||||
|
.first?
|
||||||
|
.appendingPathComponent("com.metacubex.ClashX.meta")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue