lime
lime copied to clipboard
rootPath-related improvements
This PR includes the following rootPath
-related improvements:
-
For pak libraries,
/
is always appended torootPath
, even it already ends with/
(which is the case ofrootPath
's default value./
). This leads to the pak URL containing double//
, which web servers might or might not serve correctly. The PR fixes this viaPath.join
. -
In
ManifestResources
there are various instances ofrootPath + <some path>
which fail ifrootPath
does not end with/
. The PR appends a/
in such case (it might be preferable to usePath.join
everywhere, but I wanted to keep the changes minimal).
I considered suggesting Path.addTrailingSlash()
, but I don't know if it's worth importing Path
just for that. Honestly it looks good to me the way it is.
I added a commit to help resolve the double-slash issue:
https://github.com/haxelime/lime/commit/105cc69cb7d9f495f5a353a3359f4436f3519e8c
Always adding a slash to root path will cause trouble, particularly on Android which does not resolve paths as well as a standard file system. "myfile.png" and "/myfile.png" are not the same. It may be helpful to discuss in what cases this is failing
Huh, the web UI didn't allow me to customize the commit message. I would've added that I cleaned up a bit in the process of merging. No need to use StringTools.endsWith("/")
when Path.addTrailingSlash()
checks both types of slash.