Фикс форматирования
This commit is contained in:
+20
-22
@@ -5,30 +5,28 @@
|
||||
|
||||
local function listdir(path, findpattern)
|
||||
|
||||
local list = fs.list(path)
|
||||
|
||||
for k, v in pairs(list) do
|
||||
filename = path .. "/" .. v
|
||||
if fs.isDir(filename) then
|
||||
listdir(filename, findpattern)
|
||||
else
|
||||
|
||||
if findpattern then
|
||||
local s, e = filename:find(findpattern)
|
||||
if s then
|
||||
local ls = filename:sub(1, s-1)
|
||||
local h = filename:sub(s, e)
|
||||
local le = filename:sub(e+1)
|
||||
local defcolor = term.getTextColor()
|
||||
write(ls)
|
||||
term.setTextColor(colors.red)
|
||||
write(h)
|
||||
term.setTextColor(defcolor)
|
||||
print(le)
|
||||
end
|
||||
end
|
||||
local list = fs.list(path)
|
||||
for k, v in pairs(list) do
|
||||
filename = path .. "/" .. v
|
||||
if fs.isDir(filename) then
|
||||
listdir(filename, findpattern)
|
||||
else
|
||||
if findpattern then
|
||||
local s, e = filename:find(findpattern)
|
||||
if s then
|
||||
local ls = filename:sub(1, s-1)
|
||||
local h = filename:sub(s, e)
|
||||
local le = filename:sub(e+1)
|
||||
local defcolor = term.getTextColor()
|
||||
write(ls)
|
||||
term.setTextColor(colors.red)
|
||||
write(h)
|
||||
term.setTextColor(defcolor)
|
||||
print(le)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user