Skip to content

Instantly share code, notes, and snippets.

@Zbizu
Last active May 26, 2023 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zbizu/346ad78bdc501f003fb262d372afb035 to your computer and use it in GitHub Desktop.
Save Zbizu/346ad78bdc501f003fb262d372afb035 to your computer and use it in GitHub Desktop.
Loop through all Lua files in a single directory
if getOS():lower() == "windows" then
for path in io.popen("cd \"data\lib\" && dir *.lua /b/s"):lines() do
print(path) -- path = file name/directory
end
else
for path in io.popen("cd data/lib && find . -type f | grep .lua"):lines() do
print(path)
end
end
@hinell
Copy link

hinell commented May 26, 2023

This is not a cross-platform approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment