1
0
Derivar 0

databaseLocation(): Consider env variable override

Allow overriding databaseLocation by an environment variable.

Closes: #1
Este cometimento está contido em:
Albert S. 2021-03-21 10:38:12 +01:00
ascendente 1d991b50fc
cometimento 79a26e2aa1
1 ficheiros modificados com 4 adições e 0 eliminações

Ver ficheiro

@ -14,6 +14,10 @@ import (
)
func databaseLocation() string {
envOverride := os.Getenv("HS9001_DB_PATH")
if envOverride != "" {
return envOverride
}
return filepath.Join(xdgOrFallback("XDG_DATA_HOME", filepath.Join(os.Getenv("HOME"), ".local/share")), "hs9001/db.sqlite")
}