1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-16 20:55:20 +03:00
aports/testing/luacov/reporter_fix.lua.patch
Hani Shawa affdf1723b testing/luacov: fix for luacov: patch needed for Alpine 3.14
needed nil check for "attr" in reporter.lua here:

`if attr and attr.mode == "directory" then`
and here:
`if attr and attr.mode == "file" and fileMatches(filename, '.%.lua$') then`

Signed-off-by: Hani Shawa <hani.shawa@ev-box.com>
2022-06-02 15:02:23 +00:00

20 lines
768 B
Diff

--- a/src/luacov/reporter.lua
+++ b/src/luacov/reporter.lua
@@ -25,7 +25,7 @@
entry=directory.."/"..entry
local attr=lfs.attributes(entry)
coroutine.yield(entry,attr)
- if attr.mode == "directory" then
+ if attr and attr.mode == "directory" then
yieldtree(entry)
end
end
@@ -95,7 +95,7 @@
os.exit(1)
end
for filename, attr in dirtree("./") do
- if attr.mode == "file" and fileMatches(filename, '.%.lua$') then
+ if attr and attr.mode == "file" and fileMatches(filename, '.%.lua$') then
local file_stats = {}
file_stats[0] = 0
if luacov.file_included(filename) then