Modified ospath's getConfigDir to meet XDG spec
I added a check for the XDG_CONFIG_DIR environment variable to meet the [freedesktop XDG Base Directory Specification](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)
This commit is contained in:
parent
a025901011
commit
9193bcaeec
1 changed files with 1 additions and 0 deletions
|
|
@ -517,6 +517,7 @@ when declared(getEnv) or defined(nimscript):
|
|||
tags: [ReadEnvEffect, ReadIOEffect].} =
|
||||
## Returns the config directory of the current user for applications.
|
||||
when defined(windows): return string(getEnv("APPDATA")) & "\\"
|
||||
elif getEnv("XDG_CONFIG_DIR"): return string(getEnv("XDG_CONFIG_DIR")) & "/"
|
||||
else: return string(getEnv("HOME")) & "/.config/"
|
||||
|
||||
proc getTempDir*(): string {.rtl, extern: "nos$1",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue