'nimcache' defaults to ~/.cache on Posix; cleaned up documentation
This commit is contained in:
parent
e555e97b4b
commit
e067a7681f
4 changed files with 38 additions and 37 deletions
|
|
@ -480,9 +480,19 @@ proc disableNimblePath*(conf: ConfigRef) =
|
|||
|
||||
include packagehandling
|
||||
|
||||
proc getOsCacheDir(): string =
|
||||
when defined(posix):
|
||||
result = getHomeDir() / ".cache"
|
||||
else:
|
||||
result = getHomeDir() / genSubDir
|
||||
|
||||
proc getNimcacheDir*(conf: ConfigRef): string =
|
||||
result = if conf.nimcacheDir.len > 0: conf.nimcacheDir
|
||||
else: shortenDir(conf, conf.projectPath) / genSubDir
|
||||
result = if conf.nimcacheDir.len > 0:
|
||||
conf.nimcacheDir
|
||||
elif conf.cmd == cmdCompileToJS:
|
||||
shortenDir(conf, conf.projectPath) / genSubDir
|
||||
else: getOsCacheDir() / conf.projectName &
|
||||
(if isDefined(conf, "release"): "_r" else: "_d")
|
||||
|
||||
proc pathSubs*(conf: ConfigRef; p, config: string): string =
|
||||
let home = removeTrailingDirSep(os.getHomeDir())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue