diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/cmd/init.lua | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/luarocks/cmd/init.lua b/src/luarocks/cmd/init.lua index e037fb55..5c0116ce 100644 --- a/src/luarocks/cmd/init.lua +++ b/src/luarocks/cmd/init.lua | |||
| @@ -77,14 +77,20 @@ function init.command(flags, name, version) | |||
| 77 | fs.make_dir("lua_modules/lib/luarocks/rocks-" .. cfg.lua_version) | 77 | fs.make_dir("lua_modules/lib/luarocks/rocks-" .. cfg.lua_version) |
| 78 | local tree = dir.path(pwd, "lua_modules") | 78 | local tree = dir.path(pwd, "lua_modules") |
| 79 | 79 | ||
| 80 | util.printout("Preparing ./luarocks ...") | 80 | local ext = cfg.wrapper_suffix |
| 81 | 81 | ||
| 82 | fs.wrap_script(arg[0], "luarocks", nil, nil, "--project-tree", tree) | 82 | local luarocks_wrapper = "./luarocks" .. ext |
| 83 | 83 | if not fs.exists(luarocks_wrapper) then | |
| 84 | util.printout("Preparing ./lua ...") | 84 | util.printout("Preparing " .. luarocks_wrapper .. " ...") |
| 85 | fs.wrap_script(arg[0], "luarocks", nil, nil, "--project-tree", tree) | ||
| 86 | end | ||
| 85 | 87 | ||
| 86 | path.use_tree(tree) | 88 | local lua_wrapper = "./lua" .. ext |
| 87 | fs.wrap_script(nil, "lua") | 89 | if not fs.exists(lua_wrapper) then |
| 90 | util.printout("Preparing " .. lua_wrapper .. " ...") | ||
| 91 | path.use_tree(tree) | ||
| 92 | fs.wrap_script(nil, "lua") | ||
| 93 | end | ||
| 88 | 94 | ||
| 89 | return true | 95 | return true |
| 90 | end | 96 | end |
