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)
281281 if path .type == ' dummy' then
282282 return path :isDirectory ()
283283 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'
290286end
291287
292288local function fsPairs (path , option )
616612
617613function m .scanDirectory (dir , callback )
618614 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
620617 m .scanDirectory (fullpath , callback )
621- else
618+ elseif status == ' regular ' then
622619 callback (fullpath )
623620 end
624621 end
You can’t perform that action at this time.
0 commit comments