diff options
author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-04-02 03:35:04 +0000 |
---|---|---|
committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-04-02 03:35:04 +0000 |
commit | 109e4d7128d815e084ac69ffea0281cecceb7c02 (patch) | |
tree | b6a7d4ce4afd900a87eac515821d449da6464ec6 /src | |
parent | 2bb3f37d5cb74358e2e962e79d7f4be26937eab7 (diff) | |
download | luarocks-109e4d7128d815e084ac69ffea0281cecceb7c02.tar.gz luarocks-109e4d7128d815e084ac69ffea0281cecceb7c02.tar.bz2 luarocks-109e4d7128d815e084ac69ffea0281cecceb7c02.zip |
detect Lua scripts
git-svn-id: http://luarocks.org/svn/luarocks/trunk@6 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
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 dae6259d..bc0f4594 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua | |||
@@ -464,7 +464,10 @@ function is_actual_binary(filename) | |||
464 | local file = io.open(filename) | 464 | local file = io.open(filename) |
465 | if file then | 465 | if file then |
466 | local found = false | 466 | local found = false |
467 | if file:read():match("#!/bin/sh") then | 467 | local first = file:read() |
468 | if first:match("#!.*lua") then | ||
469 | found = true | ||
470 | elseif first:match("#!/bin/sh") then | ||
468 | local line = file:read() | 471 | local line = file:read() |
469 | line = file:read() | 472 | line = file:read() |
470 | if not(line and line:match("LUA_PATH")) then | 473 | if not(line and line:match("LUA_PATH")) then |