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:
Jonathan Arnett
2017-04-22 15:19:15 -04:00
parent a025901011
commit 9193bcaeec

View File

@@ -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",