diff options
author | Clyybber <darkmine956@gmail.com> | 2020-08-28 22:18:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 22:18:09 +0200 |
commit | 13e659cfec83eb3c2c3c2bbbf10d01ba59bc0d5b (patch) | |
tree | 6df6a9dfc3b5f0ba7f27452c8f84b55a957b73ba /compiler/options.nim | |
parent | f8c48fc1863a243718acf86b699baed1a5c1512e (diff) | |
download | Nim-13e659cfec83eb3c2c3c2bbbf10d01ba59bc0d5b.tar.gz |
Big compiler Cleanup (#14777)
Diffstat (limited to 'compiler/options.nim')
-rw-r--r-- | compiler/options.nim | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index b5fb546ef..8ff8cb753 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -691,12 +691,10 @@ iterator nimbleSubs*(conf: ConfigRef; p: string): string = proc toGeneratedFile*(conf: ConfigRef; path: AbsoluteFile, ext: string): AbsoluteFile = ## converts "/home/a/mymodule.nim", "rod" to "/home/a/nimcache/mymodule.rod" - let (head, tail) = splitPath(path.string) - result = getNimcacheDir(conf) / RelativeFile changeFileExt(tail, ext) + result = getNimcacheDir(conf) / RelativeFile path.string.splitPath.tail.changeFileExt(ext) proc completeGeneratedFilePath*(conf: ConfigRef; f: AbsoluteFile, createSubDir: bool = true): AbsoluteFile = - let (head, tail) = splitPath(f.string) let subdir = getNimcacheDir(conf) if createSubDir: try: @@ -704,7 +702,7 @@ proc completeGeneratedFilePath*(conf: ConfigRef; f: AbsoluteFile, except OSError: writeLine(stdout, "cannot create directory: " & subdir.string) quit(1) - result = subdir / RelativeFile tail + result = subdir / RelativeFile f.string.splitPath.tail #echo "completeGeneratedFilePath(", f, ") = ", result proc rawFindFile(conf: ConfigRef; f: RelativeFile; suppressStdlib: bool): AbsoluteFile = |