janet-lang / jpm

Janet Project Manager
MIT License
65 stars 21 forks source link

shutil/copy: convert all path seperators for xcopy #45

Closed ishehadeh closed 2 years ago

ishehadeh commented 2 years ago

The shutil/copy method converts / to \\ with (string/replace) but that function only replaces the first instance of the pattern. So if a path with multiple /s was passed to shutil/copy on windows xcopy.exe would fail.

This is PR just changes string/replace -> string/replace-all

kamisori commented 2 years ago

i've been stumbling over path seperators too, during bootstrap of jpm, stuff is copied to for example:

c:\foobar\path\to\janet\/jpm

it does a good job of realizing the \/ is another path seperator and there is nothing between, but seeing this being printed, i feel like os-aware filepathhandling could really use becoming part of janets core api..