From a2a3d1595c628111fcbcac8571a7513a8b15e405 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 28 Aug 2019 13:45:11 -0300 Subject: cmd: move cross-compilation hack to the right place --- src/luarocks/cmd.lua | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index f424f488..a1ec1c14 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua @@ -282,19 +282,6 @@ do init_config = function(args) local detected = detect_config_via_args(args) - -- FIXME A quick hack for the experimental Windows build - if os.getenv("LUAROCKS_CROSS_COMPILING") then - cfg.each_platform = function() - local i = 0 - local plats = { "unix", "linux" } - return function() - i = i + 1 - return plats[i] - end - end - fs.init() - end - local ok, err = cfg.init(detected, util.warning) if not ok then return nil, err @@ -445,6 +432,18 @@ function cmd.run_command(description, commands, external_namespace, ...) check_popen() + -- FIXME A quick hack for the experimental Windows build + if os.getenv("LUAROCKS_CROSS_COMPILING") then + cfg.each_platform = function() + local i = 0 + local plats = { "unix", "linux" } + return function() + i = i + 1 + return plats[i] + end + end + end + fs.init() for _, module_name in ipairs(fs.modules(external_namespace)) do -- cgit v1.2.3-55-g6feb