Created
March 10, 2018 14:19
-
-
Save flamendless/2caf7cb59e4551dd579201d8c7ab69ca to your computer and use it in GitHub Desktop.
Love2D api/wiki trimmer (removes non-english .html files). Also useful for other batch deletion using lua and lfs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--LOVE2D api/wiki trimmer | |
--Also useful for other batch deletion using lua and lfs | |
--Created by Brandon Blanker Lim-it @flamendless | |
local lfs = require("lfs") | |
local toRemove = { | |
"_deutsch", | |
"_portugu", | |
"_fran", | |
"_polski", | |
"_espa", | |
"_esky", | |
"_ti_ng_vi_" | |
} | |
local dir = arg[1] | |
assert(dir, "arg1 is the directory where the files are stored.") | |
for file in lfs.dir(dir) do | |
for _, tr in pairs(toRemove) do | |
if string.find(file, tr) then | |
print(file .. " is removed: " .. tostring(os.remove(dir .. "/" .. file))) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment