File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -281,12 +281,8 @@ local function fsIsDirectory(path, option)
281
281
if path .type == ' dummy' then
282
282
return path :isDirectory ()
283
283
end
284
- local suc , res = pcall (fs .is_directory , path )
285
- if not suc then
286
- option .err [# option .err + 1 ] = res
287
- return false
288
- end
289
- return res
284
+ local status = fs .symlink_status (path ):type ()
285
+ return status == ' directory'
290
286
end
291
287
292
288
local function fsPairs (path , option )
616
612
617
613
function m .scanDirectory (dir , callback )
618
614
for fullpath in fs .pairs (dir ) do
619
- if fs .is_directory (fullpath ) then
615
+ local status = fs .symlink_status (fullpath ):type ()
616
+ if status == ' directory' then
620
617
m .scanDirectory (fullpath , callback )
621
- else
618
+ elseif status == ' regular ' then
622
619
callback (fullpath )
623
620
end
624
621
end
You can’t perform that action at this time.
0 commit comments