shell utils fixes

This commit is contained in:
kepler155c@gmail.com
2019-04-08 09:31:13 -04:00
parent fba1546213
commit a16510e254
3 changed files with 10 additions and 8 deletions

View File

@@ -85,10 +85,12 @@ local function visitor(rpath)
if fs.isDirectory(spath) then
local list_result = fs.list(spath)
for list_item in list_result do
local vtotal, vdirs = visitor(addTrailingSlash(rpath) .. list_item)
subtotal = subtotal + vtotal
dirs = dirs + vdirs
if list_result then
for list_item in list_result do
local vtotal, vdirs = visitor(addTrailingSlash(rpath) .. list_item)
subtotal = subtotal + vtotal
dirs = dirs + vdirs
end
end
if dirs == 0 then -- no child dirs