-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convenient way of generating Lua files for every tl file? #31
Comments
I guess we can call this one fixed by #42, since you can run |
Yes, that works. However, I would prefer if there was some way to specify the input files inside For instance, the syntax for globs is shell dependent, especially when we get to patterns like I'd be happy if tlconfig supported something akin to the "include" and "exclude" properties in tsconfig.json. This would allow using globs for input files in a platform independent manner. For the time being, though, I suppose a simple |
Yeah, that should be an easy add. Anything involving globs would take some extra dependency to do the directory traversal. |
It seems like lua-path supports globs: local path = require("path")
local src = "./game/*.lua"
path.each(src, "f", function(full_path)
print(full_path)
end, {
recurse = true; -- include subdirs
}) This library could also be used for building paths in #47. Otherwise, there is also lpath: local fs = require("path.fs")
-- find all .lua files in directory "game"
local src = "game/*/*.lua"
local files = fs.glob(src)
for _, v in ipairs(files) do
-- do something
end Are you aware of a better library for this? |
Not really! At first glance it doesn't look like either of them supports the zsh/typescript In any case, I have no immediate preference, it's up to you to pick the library if you're interested in adding the feature! |
@hishamhm So I'm working on a pr for this and was wondering if we should change the |
@euclidianAce I added the With that said, maybe it would be better to rename the current |
I kinda like the fact that |
Fixed by #177. |
Right now, it seems like I need to manually call
tl gen <filename>
for every tl file in my project.While I can write a script to automate this, I suppose it would be nice if there was a built-in way of generating Lua files for multiple tl modules at once.
For instance, in TypeScript, we can specify the input files inside tsconfig.json and run
tsc
to compile the whole project.The text was updated successfully, but these errors were encountered: