* * relativePath(foo) now works * relativePath(rel, abs) and relativePath(abs, rel) now work (fixes #13222) * relativePath, absolutePath, getCurrentDir now available in more targets (eg: vm, nodejs etc) * fix bug: isAbsolutePath now works with -d:js; add tests * workaround https://github.com/nim-lang/Nim/issues/13469 * remove `relativePath(path)` overload for now * add back changelog after rebase
This commit is contained in:
parent
dd24004fab
commit
7ce0358351
4 changed files with 113 additions and 68 deletions
|
|
@ -348,6 +348,9 @@ block ospaths:
|
|||
doAssert relativePath("", "foo") == ""
|
||||
doAssert relativePath("././/foo", "foo//./") == "."
|
||||
|
||||
doAssert relativePath(getCurrentDir() / "bar", "foo") == "../bar".unixToNativePath
|
||||
doAssert relativePath("bar", getCurrentDir() / "foo") == "../bar".unixToNativePath
|
||||
|
||||
when doslikeFileSystem:
|
||||
doAssert relativePath(r"c:\foo.nim", r"C:\") == r"foo.nim"
|
||||
doAssert relativePath(r"c:\foo\bar\baz.nim", r"c:\foo") == r"bar\baz.nim"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue