feat: Breaking out more dependencies.
This commit is contained in:
28
Sources/ConfigurationClient/Constants.swift
Normal file
28
Sources/ConfigurationClient/Constants.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
@_spi(Internal)
|
||||
public enum EnvironmentKey {
|
||||
static let xdgConfigHome = "XDG_CONFIG_HOME"
|
||||
static let hpaConfigHome = "HPA_CONFIG_HOME"
|
||||
static let hpaConfigFile = "HPA_CONFIG_FILE"
|
||||
}
|
||||
|
||||
@_spi(Internal)
|
||||
public enum HPAKey {
|
||||
public static let configDirName = "hpa"
|
||||
public static let resourceFileName = "hpa"
|
||||
public static let resourceFileExtension = "toml"
|
||||
public static let defaultFileName = "config.toml"
|
||||
}
|
||||
|
||||
extension [String: String] {
|
||||
var xdgConfigHome: String {
|
||||
self[EnvironmentKey.xdgConfigHome] ?? "~/.config"
|
||||
}
|
||||
|
||||
var hpaConfigHome: String? {
|
||||
self[EnvironmentKey.hpaConfigHome]
|
||||
}
|
||||
|
||||
var hpaConfigFile: String? {
|
||||
self[EnvironmentKey.hpaConfigFile]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user