aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/cmd/config.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/cmd/config.lua b/src/luarocks/cmd/config.lua
index 6a73c7ff..0227b18d 100644
--- a/src/luarocks/cmd/config.lua
+++ b/src/luarocks/cmd/config.lua
@@ -280,7 +280,12 @@ function config_cmd.command(args)
280 return nil, "Current directory is not part of a project. You may want to run `luarocks init`." 280 return nil, "Current directory is not part of a project. You may want to run `luarocks init`."
281 end 281 end
282 282
283 local prefix = dir.dir_name(cfg.config_files[scope].file) 283 local location = cfg.config_files[scope]
284 if (not location) or (not location.file) then
285 return nil, "could not get config file location for " .. tostring(scope) .. " scope"
286 end
287
288 local prefix = dir.dir_name(location.file)
284 local ok, err = persist.save_default_lua_version(prefix, args.value) 289 local ok, err = persist.save_default_lua_version(prefix, args.value)
285 if not ok then 290 if not ok then
286 return nil, "could not set default Lua version: " .. err 291 return nil, "could not set default Lua version: " .. err