You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GetDirectory only works if source path is for example "LuaUI/Widgets/"
and not if it is for example "LuaUI\Widgets"
Not sure about Linux but on Windows debug and debug.getinfo(1).source will have backslash ( \ )
local source = debug and debug.getinfo(1).source
local DIR = GetDirectory(source)
local function GetDirectory(filepath)
return filepath and filepath:gsub("(.*/)(.*)", "%1")
end
Possible fix:
local function GetDirectory(filepath)
local split,isFSlash = filepath:gsub("(.*/)(.*)", "%2")
if isFSlash == 0 then
return filepath:gsub("(.*\\)(.*)", "%1")
end
return filepath:gsub(split,"")
end
The text was updated successfully, but these errors were encountered:
GetDirectory only works if source path is for example "LuaUI/Widgets/"
and not if it is for example "LuaUI\Widgets"
Not sure about Linux but on Windows debug and debug.getinfo(1).source will have backslash ( \ )
Possible fix:
The text was updated successfully, but these errors were encountered: