mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Plugin improvements (require vs dofile)
This commit is contained in:
parent
2e16c2b76c
commit
5fe50b0fd5
2 changed files with 13 additions and 4 deletions
|
|
@ -9,9 +9,12 @@ local lua_path_utils = {}
|
|||
function lua_path_utils.package_path_preprend(path)
|
||||
local include_path = path.."/?.lua;"
|
||||
|
||||
if not package.path:match(include_path) then
|
||||
package.path = include_path..package.path
|
||||
-- If the path is already inside package.path, we remove it, before prepending it
|
||||
if not package.path:starts(include_path) and package.path:gmatch(include_path) then
|
||||
package.path = package.path:gsub(include_path, '')
|
||||
end
|
||||
|
||||
package.path = include_path..package.path
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue