lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 5/14/23 22:09, Scott Morgan wrote:
On 5/15/23 01:15, Soni "They/Them" L. wrote:
Hello,

We are wondering, if it would be possible to support foo.lua.d/bar.lua for require("foo.bar").

See, Linux really really wants file-dir duality. You can tell by all the .d/'s everywhere. Unfortunately POSIX forbids file-dir duality. So .d/'s everywhere is the best we're gonna get. But it'd be nice to see them more widely supported.

Wouldn't foo/init.lua + foo/bar.lua  achieve the same result for you?

foo = require"foo"
bar = require"foo.bar"

Beyond that, just tweak the package.* items to suit your particular requirements.

No, since that is not using the convention of treating the contents of foo.lua.d/ as subfiles of foo.lua.


Scott