Forums » Suggestions

Lua - Get Directory of Calling Plugin

Jan 04, 2023 draugath link
I would like to see a function added to the API which would allow the calling plugin to query the name of the directory it resides in.

There are two different relative paths to the plugin directory depending on whether the plugin load process is on-going or finished. Most plugins may load all of their files or images at the same time, but there are some that do so after load. This would allow them to get their directory without requiring that it be hardcoded. This would also avoid the potential problem of a plugin breaking because it's directory was renamed for some reason.