Code: Select all
-- Replace '.' if using `require 'Path.to.lib'`
function require( inputPath ) -- or whatever it is
local currentPath = ''
local currentIndex = 0
while #currentPath ~= #inputPath do
local _, index, temp = inputPath:find( '(.-)%.', currentIndex )
if love.filesystem.exists( currentPath .. temp ) then -- Allow for . in folder names
currentPath = currentPath .. temp .. '/'
currentIndex = index + 1
end
end
return currentPath
end
Is this a Lua problem, or a LÖVE problem?
Edit: Uploaded .love example