قرینه از
https://github.com/quitesimpleorg/hs9001.git
synced 2024-11-25 02:22:37 +01:00
databaseLocation(): Consider env variable override
Allow overriding databaseLocation by an environment variable. Closes: #1
This commit is contained in:
والد
1d991b50fc
کامیت
79a26e2aa1
4
main.go
4
main.go
@ -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")
|
||||
}
|
||||
|
||||
|
بارگذاری…
مرجع در شماره جدید
Block a user