Page 2 of 2

Re: Can't make require function work

Posted: Fri Jan 06, 2017 7:46 pm
by kikito
airstruck wrote: Are you running Debian? I had the impression this was something weird the Debian package maintainers did, and it didn't affect other platforms. I'm not sure it's Lua's fault; as far as I know they don't make any recommendation for what exactly should go in package.path (from LUA_PATH or luaconf.h), so it's just up to package maintainers to do something sensible.
I am not, I'm on OSX. I am pretty sure this is Lua. They could have included '?/init.lua' in the definition of LUA_PATH_DEFAULT long time ago, but for some reason it isn't there.

Re: Can't make require function work

Posted: Fri Jan 06, 2017 8:00 pm
by airstruck
kikito wrote: I am not, I'm on OSX. I am pretty sure this is Lua. They could have included '?/init.lua' in the definition of LUA_PATH_DEFAULT long time ago, but for some reason it isn't there.
It's right there on lines 195 and 209, isn't it?

It looks like it's been there since 2013, which should mean that default setting made it into 5.3 at least. In any case, it's strange that OP reports it doesn't work in Love, since Love's default require path does include ?/init.lua (see getRequirePath and setRequirePath). In my experience ?/init.lua works fine in Love, as the wiki suggests.