Closed Shallowmallow closed 3 months ago
under what conditions would / could the path be absolute?
I was trying to add ressources in my module
I have some that are on a external drive
<resource path='/media/[...]/assets' prefix="assets"/>
Now on linux, I can always do a symlink, but for windows...
weird, im actually kinda surprised it didnt "just work" before... :/
huh, yeah:
WARNING: Could not resolve resource path C:\Temp\haxeui-testapps\testbench-universal\assets\absolute_path
Was surprised too ^^ . But 99% of the time we use relative paths, so it wasn't really noticeable.
yeah, just looked at the code and, as im sure you noticed, it was limited to classpath entries, so your change makes alot of sense
as you say, its probably not going to be used very often since absolute paths feel a little "wrong", but yeah, change make sense... just hope there arent false positives that trigger the "isAbsolute" (will check now what that means in haxe land)
public static function isAbsolute(path:String):Bool {
if (StringTools.startsWith(path, '/'))
return true;
if (path.charAt(1) == ':')
return true;
if (StringTools.startsWith(path, '\\\\'))
return true;
return false;
}
probably should be fine...
So that
<resource path='/media/[...]/assets' prefix="assets"/>
can work I didn't put an if else because of paths like/haxe/ui/_module/styles
that are use by haxe ui core