diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-07-13 19:11:51 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-07-17 20:30:44 -0300 |
commit | 12bdbc927721f0b12db20c5ba0612c78bb670376 (patch) | |
tree | 713eceeb3a0ea41468dfe2e6ba1106e528c2a293 /src | |
parent | 72d80a35bee56bd8f8002b199db37f89c1441c29 (diff) | |
download | luarocks-12bdbc927721f0b12db20c5ba0612c78bb670376.tar.gz luarocks-12bdbc927721f0b12db20c5ba0612c78bb670376.tar.bz2 luarocks-12bdbc927721f0b12db20c5ba0612c78bb670376.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fs/unix.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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) | |||
220 | return true | 220 | return true |
221 | end | 221 | end |
222 | if fd then | 222 | if fd then |
223 | local _, _, ecode = fd:read(1) | ||
223 | fd:close() | 224 | fd:close() |
224 | return true | 225 | if ecode == 21 then -- "Is a directory" |
226 | return true | ||
227 | end | ||
225 | end | 228 | end |
226 | return false | 229 | return false |
227 | end | 230 | end |