Closed Nimblz closed 4 years ago
This makes sense, but I'm unsure if this feature is worthwhile from a duplication and consistency perspective.
A comparison of equivalent features from other languages:
Foo/init.lua
Foo/__init__.py
Foo/mod.rs
OR Foo.rs
next to Foo/
If we had to go back to when I created the first init.lua
file at Roblox, maybe it should've been __init__.lua
instead?
What happens if you have both _init.lua
and init.lua
? Rojo explodes?
It could skip over that script+children, then warn the user that the source is ambiguous and as such it cant reconcile that portion.
We already have to face that problem when init.lua
, init.server.lua
, init.client.lua
, and init.meta.json
are specified together. Right now, we just do Something Unspecified, but we should probably tell the user something is up.
I'm going to go ahead and close this issue. We can revisit it at a later time, but I think consistency is more important right now.
For libraries with many child modules I find myself having to search for init.lua
Rojo should recognize init scripts with a name like
_init
This sorts these files at the very top of their directory (when sorting alphabetically) and better visually groups them with their parent directory when viewed as a tree (see images).
Without underscore:
With underscore: