Simplified process startup on macOS and Linux
This commit is contained in:
parent
9e03c9680c
commit
b462f3fb6c
40 changed files with 1343 additions and 1157 deletions
22
Apple/Shared/Constants.swift
Normal file
22
Apple/Shared/Constants.swift
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
@_implementationOnly import Constants
|
||||
|
||||
public enum Constants {
|
||||
enum Error: Swift.Error {
|
||||
case invalidAppGroupIdentifier
|
||||
}
|
||||
|
||||
public static let bundleIdentifier = AppBundleIdentifier
|
||||
public static let appGroupIdentifier = AppGroupIdentifier
|
||||
|
||||
public static var groupContainerURL: URL {
|
||||
get throws { try _groupContainerURL.get() }
|
||||
}
|
||||
|
||||
private static let _groupContainerURL: Result<URL, Error> = {
|
||||
guard let groupContainerURL = FileManager.default
|
||||
.containerURL(forSecurityApplicationGroupIdentifier: appGroupIdentifier) else {
|
||||
return .failure(.invalidAppGroupIdentifier)
|
||||
}
|
||||
return .success(groupContainerURL)
|
||||
}()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue