Don't assume lite lives at the root of the repo

This commit is contained in:
Jeremy Penner 2020-11-19 21:23:36 -05:00
parent 2783adc10c
commit 9bec18e4aa

View file

@ -233,14 +233,28 @@ function system.fuzzy_match(str, ptn)
end
table.unpack = unpack
PATHSEP = package.config:sub(1, 1)
ARGS = love.arg.parseGameArguments(arg)
VERSION = "1.11"
PLATFORM = "love2d"
SCALE = love.graphics.getDPIScale()
EXEDIR = ""
PATHSEP = package.config:sub(1, 1)
-- love.filesystem.mount(love.filesystem.getSourceBaseDirectory(), love.filesystem.getSourceBaseDirectory())
package.path = love.filesystem.getWorkingDirectory() .. '/data/?.lua;' .. love.filesystem.getWorkingDirectory() .. '/data/?/init.lua;' .. package.path
local modname = ...
local ilastdot = modname:reverse():find("%.")
EXEDIR = modname:gsub("%.", PATHSEP)
if ilastdot then
EXEDIR = EXEDIR:sub(1, (-1 - ilastdot))
else
EXEDIR = ""
end
local literoot = love.filesystem.getWorkingDirectory()
if #EXEDIR > 0 then
literoot = literoot .. PATHSEP .. EXEDIR
end
package.path = literoot .. '/data/?/init.lua;' .. package.path
package.path = literoot .. '/data/?.lua;' .. package.path
function love.run()
local core = require('core')