From 0931933acc19ba7aff11afe7a1f9d52929ca0d43 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sat, 17 Feb 2024 03:21:19 -0300 Subject: fix: catch the failure to setup LUA_BINDIR early. Fixes #1202. --- src/luarocks/cmd.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 2db0c039..250e3cff 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua @@ -674,6 +674,12 @@ function cmd.run_command(description, commands, external_namespace, ...) os.exit(cmd.errorcodes.OK) end + if not cfg.variables["LUA_BINDIR"] then + return nil, "LUA_BINDIR not configured.\n" .. + "Please configure the location of the Lua interpreter with:\n" .. + " luarocks config variables.LUA_BINDIR " + end + local cmd_mod = cmd_modules[args.command] local lock -- cgit v1.2.3-55-g6feb