Updated code to use tabs for alignment
This commit is contained in:
parent
52e15b3b05
commit
f14def1b91
@ -275,32 +275,32 @@
|
||||
-- @return true on success, false and an appropriate error message on error
|
||||
--
|
||||
-- @example ok, err = os.remove{"**.bak", "**.log"}
|
||||
-- if not ok then
|
||||
-- error(err)
|
||||
-- end
|
||||
-- if not ok then
|
||||
-- error(err)
|
||||
-- end
|
||||
--
|
||||
|
||||
local builtin_remove = os.remove
|
||||
function os.remove(f)
|
||||
-- in case of string, just match files
|
||||
if type(f) == "string" then
|
||||
local p = os.matchfiles(f)
|
||||
for _, v in pairs(p) do
|
||||
local ok, err = builtin_remove(v)
|
||||
if not ok then
|
||||
return ok, err
|
||||
end
|
||||
end
|
||||
-- in case of table, match files for every table entry
|
||||
elseif type(f) == "table" then
|
||||
for _, v in pairs(f) do
|
||||
local ok, err = os.remove(v)
|
||||
local builtin_remove = os.remove
|
||||
function os.remove(f)
|
||||
-- in case of string, just match files
|
||||
if type(f) == "string" then
|
||||
local p = os.matchfiles(f)
|
||||
for _, v in pairs(p) do
|
||||
local ok, err = builtin_remove(v)
|
||||
if not ok then
|
||||
return ok, err
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- in case of table, match files for every table entry
|
||||
elseif type(f) == "table" then
|
||||
for _, v in pairs(f) do
|
||||
local ok, err = os.remove(v)
|
||||
if not ok then
|
||||
return ok, err
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
|
Reference in New Issue
Block a user