From 12bdbc927721f0b12db20c5ba0612c78bb670376 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sat, 13 Jul 2019 19:11:51 -0300 Subject: Fix fs.is_dir detection on the Mac, take 2 Thanks to @andyli for the report and pointer to the failing CI build. Fixes #104 --- src/luarocks/fs/unix.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index eb7d870b..3e05fbf3 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua @@ -220,8 +220,11 @@ function unix.is_dir(file) return true end if fd then + local _, _, ecode = fd:read(1) fd:close() - return true + if ecode == 21 then -- "Is a directory" + return true + end end return false end -- cgit v1.2.3-55-g6feb