summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorJonathan Arnett <jonarnett90@gmail.com>2017-04-22 15:19:15 -0400
committerJonathan Arnett <jonarnett90@gmail.com>2017-04-28 14:33:15 -0400
commit9193bcaeecd567d40015e352a5320b657edea34a (patch)
tree241d28bf9119a378db65b504bb45f0cc4369e4d2 /lib
parenta0259010117bf9ba2ee37e4014c80c5102b05cff (diff)
downloadNim-9193bcaeecd567d40015e352a5320b657edea34a.tar.gz
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)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/ospaths.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim
index 71991e35a..4c667dd92 100644
--- a/lib/pure/ospaths.nim
+++ b/lib/pure/ospaths.nim
@@ -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",