Skip to content

Commit

Permalink
make ospaths compile; fixes ospaths.getConfigDir for Posix
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Aug 23, 2018
1 parent 361a2d8 commit 1c3cfd7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/pure/ospaths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,11 @@ proc getConfigDir*(): string {.rtl, extern: "nos$1",
##
## An OS-dependent trailing slash is always present at the end of the
## returned string; `\\` on Windows and `/` on all other OSs.
when defined(windows): return string(getEnv("APPDATA")) & "\\"
elif getEnv("XDG_CONFIG_HOME"): return string(getEnv("XDG_CONFIG_HOME")) & "/"
else: return string(getEnv("HOME")) & "/.config/"
when defined(windows):
result = string(getEnv("APPDATA")) & "\\"
else:
result = string(getEnv("XDG_CONFIG_HOME", "")) & "/"
if result == "/": result = string(getEnv("HOME")) & "/.config/"

proc getTempDir*(): string {.rtl, extern: "nos$1",
tags: [ReadEnvEffect, ReadIOEffect].} =
Expand Down

0 comments on commit 1c3cfd7

Please sign in to comment.