diff options
-rw-r--r-- | src/luarocks/loader.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/loader.lua b/src/luarocks/loader.lua index 969f4844..5aa84632 100644 --- a/src/luarocks/loader.lua +++ b/src/luarocks/loader.lua | |||
@@ -29,7 +29,8 @@ local require = nil | |||
29 | 29 | ||
30 | -- Workaround for wrappers produced by older versions of LuaRocks | 30 | -- Workaround for wrappers produced by older versions of LuaRocks |
31 | local temporary_global = false | 31 | local temporary_global = false |
32 | if luarocks then | 32 | local status, luarocks_value = pcall(function() return luarocks end) |
33 | if status and luarocks_value then | ||
33 | -- The site_config.lua file generated by old versions uses module(), | 34 | -- The site_config.lua file generated by old versions uses module(), |
34 | -- so it produces a global `luarocks` table. Since we have the table, | 35 | -- so it produces a global `luarocks` table. Since we have the table, |
35 | -- add the `loader` field to make the old wrappers happy. | 36 | -- add the `loader` field to make the old wrappers happy. |