aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-04-17 18:46:08 -0300
committerHisham Muhammad <hisham@gobolinux.org>2020-04-22 17:10:21 -0300
commit01a83b9b8377f66c5258892bc85fff5c218fdbb7 (patch)
tree3c01cc206ef023b614c2499e010c0617d0d951a0
parent7e595c685b40670ee91c3c3723b7788115a13165 (diff)
downloadluarocks-01a83b9b8377f66c5258892bc85fff5c218fdbb7.tar.gz
luarocks-01a83b9b8377f66c5258892bc85fff5c218fdbb7.tar.bz2
luarocks-01a83b9b8377f66c5258892bc85fff5c218fdbb7.zip
config: be smarter when configuring the location of Lua
If no system-wide permissions, try storing the config locally by default. Also, if setting both lua_dir and --lua-version explicitly, switch the default Lua version.
-rw-r--r--src/luarocks/cmd/config.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/cmd/config.lua b/src/luarocks/cmd/config.lua
index 6d3543b5..bdabe960 100644
--- a/src/luarocks/cmd/config.lua
+++ b/src/luarocks/cmd/config.lua
@@ -233,7 +233,8 @@ local function get_scope(args)
233 or (args["local"] and "user") 233 or (args["local"] and "user")
234 or (args.project_tree and "project") 234 or (args.project_tree and "project")
235 or (cfg.local_by_default and "user") 235 or (cfg.local_by_default and "user")
236 or "system" 236 or (fs.is_writable(cfg.config_files["system"].file and "system"))
237 or "user"
237end 238end
238 239
239--- Driver function for "config" command. 240--- Driver function for "config" command.