Фикс форматирования

This commit is contained in:
2026-07-26 11:19:50 +00:00
parent 25d06d8f9d
commit b88e8121bb
+20 -22
View File
@@ -5,30 +5,28 @@
local function listdir(path, findpattern) local function listdir(path, findpattern)
local list = fs.list(path) local list = fs.list(path)
for k, v in pairs(list) do
for k, v in pairs(list) do filename = path .. "/" .. v
filename = path .. "/" .. v if fs.isDir(filename) then
if fs.isDir(filename) then listdir(filename, findpattern)
listdir(filename, findpattern) else
else if findpattern then
local s, e = filename:find(findpattern)
if findpattern then if s then
local s, e = filename:find(findpattern) local ls = filename:sub(1, s-1)
if s then local h = filename:sub(s, e)
local ls = filename:sub(1, s-1) local le = filename:sub(e+1)
local h = filename:sub(s, e) local defcolor = term.getTextColor()
local le = filename:sub(e+1) write(ls)
local defcolor = term.getTextColor() term.setTextColor(colors.red)
write(ls) write(h)
term.setTextColor(colors.red) term.setTextColor(defcolor)
write(h) print(le)
term.setTextColor(defcolor)
print(le)
end
end
end end
end
end end
end
end end