-
Notifications
You must be signed in to change notification settings - Fork 7.6k
A way to get extensions current directory #831
Comments
You can use require.toUrl() to make a path relative to the extension's own directory. For example:
|
toUrl seems to return a reference to a JS file. Doesn't work for a directory. |
Bummer, you're right, it doesn't work right for a directory. In the meantime you could use toUrl("data/.") and just strip the final "." |
looks like you can also use for example, to load from the data folder of my extension, I can do: |
Moving to the backlog - we need to prioritize probably a number of extensibility stories. |
Fix in progress: #943 |
Fixed. I added FileUtils.getNativeModuleDirectoryPath(). Take a look at src/extensions/disabled/JavaScriptInlineEditor/unittests.js for an example. |
Awesome, just tried it and it works great. Thanks! |
Currently I have
FileUtils.getNativeBracketsDirectoryPath() + "/extensions/user/brackets-snippets/data"
Would be awesome if I had something to get the extension's own directory
The text was updated successfully, but these errors were encountered: