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
commit 9193bcaeec
No known key found for this signature in database
GPG key ID: 68A91E8E3A8BD47D

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