make ospaths compile; fixes ospaths.getConfigDir for Posix
This commit is contained in:
parent
361a2d830a
commit
1c3cfd74ff
1 changed files with 5 additions and 3 deletions
|
|
@ -531,9 +531,11 @@ proc getConfigDir*(): string {.rtl, extern: "nos$1",
|
||||||
##
|
##
|
||||||
## An OS-dependent trailing slash is always present at the end of the
|
## An OS-dependent trailing slash is always present at the end of the
|
||||||
## returned string; `\\` on Windows and `/` on all other OSs.
|
## returned string; `\\` on Windows and `/` on all other OSs.
|
||||||
when defined(windows): return string(getEnv("APPDATA")) & "\\"
|
when defined(windows):
|
||||||
elif getEnv("XDG_CONFIG_HOME"): return string(getEnv("XDG_CONFIG_HOME")) & "/"
|
result = string(getEnv("APPDATA")) & "\\"
|
||||||
else: return string(getEnv("HOME")) & "/.config/"
|
else:
|
||||||
|
result = string(getEnv("XDG_CONFIG_HOME", "")) & "/"
|
||||||
|
if result == "/": result = string(getEnv("HOME")) & "/.config/"
|
||||||
|
|
||||||
proc getTempDir*(): string {.rtl, extern: "nos$1",
|
proc getTempDir*(): string {.rtl, extern: "nos$1",
|
||||||
tags: [ReadEnvEffect, ReadIOEffect].} =
|
tags: [ReadEnvEffect, ReadIOEffect].} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue