diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-05-31 03:04:36 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-05-31 03:04:45 +0200 |
commit | 893be3a5a40cbbceb211efe47361632ccdbed227 (patch) | |
tree | fc7d1eae670fd6703b06022d2d836a6b40f68c75 /compiler/options.nim | |
parent | 1e5926458c2d18dec3389d00f41680518fb939c0 (diff) | |
download | Nim-893be3a5a40cbbceb211efe47361632ccdbed227.tar.gz |
changed the compiler's path handling; fixes #546
Diffstat (limited to 'compiler/options.nim')
-rw-r--r-- | compiler/options.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index 2716a98d3..3ef6c6c46 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -242,6 +242,21 @@ proc getNimcacheDir*: string = result = if nimcacheDir.len > 0: nimcacheDir else: gProjectPath.shortenDir / genSubDir + +proc pathSubs*(p, config: string): string = + let home = removeTrailingDirSep(os.getHomeDir()) + result = unixToNativePath(p % [ + "nim", getPrefixDir(), + "lib", libpath, + "home", home, + "config", config, + "projectname", options.gProjectName, + "projectpath", options.gProjectPath, + "projectdir", options.gProjectPath, + "nimcache", getNimcacheDir()]) + if '~' in result: + result = result.replace("~", home) + template newPackageCache(): expr = newStringTable(when FileSystemCaseSensitive: modeCaseInsensitive |