Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

less imports loading is still broken on linux and mac #7513

Closed
zaggino opened this issue Apr 15, 2014 · 5 comments · Fixed by #7522
Closed

less imports loading is still broken on linux and mac #7513

zaggino opened this issue Apr 15, 2014 · 5 comments · Fixed by #7522

Comments

@zaggino
Copy link
Contributor

zaggino commented Apr 15, 2014

Noticed in brackets-userland/brackets-git#396
Related to #7230

image

@zaggino
Copy link
Contributor Author

zaggino commented Apr 15, 2014

cc @redmunds

@zaggino
Copy link
Contributor Author

zaggino commented Apr 15, 2014

Maybe just wrong function is used here ... something like this would be required:

if (brackets.platform === "win") { return url.match(/^[a-zA-Z]:(\\|\/)/); }
else { return url.match(/^\//); }

@peterflynn
Copy link
Member

@zaggino That's not a URL, so this API won't behave the way you're expecting. I think you'd want to use FileSystem.isAbsolutePath()

@zaggino
Copy link
Contributor Author

zaggino commented Apr 15, 2014

ah, sometimes I feel really lame when I read things after myself ... gonna fix this in a PR soon ...

@zaggino zaggino changed the title PathUtils.isAbsoluteUrl returns false on absolute urls in Linux less imports loading is still broken on linux and mac Apr 15, 2014
@zaggino
Copy link
Contributor Author

zaggino commented Apr 15, 2014

on windows it looks like this:

url
"file:///C:/Users/martinz/AppData/Roaming/Brackets/extensions/user/zaggino.brackets-git/styles/brackets-git.less"
FileSystem.isAbsolutePath(url)
false
PathUtils.isAbsoluteUrl(url)
true

on linux like this:

url
"/home/user/.config/Brackets/extensions/user/zaggino.brackets-git/styles/brackets-git.less"
FileSystem.isAbsolutePath(url)
true
PathUtils.isAbsoluteUrl(url)
false

i need true in both cases so do you think
FileSystem.isAbsolutePath(url) || PathUtils.isAbsoluteUrl(url)
is appropriate here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants