aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/cfg.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/cfg.lua')
-rw-r--r--src/luarocks/cfg.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 70c16a2a..ba8c7f22 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -149,11 +149,11 @@ sys_config_file = site_config.LUAROCKS_SYSCONFIG or sys_config_dir.."/config-"..
149local err, errcode 149local err, errcode
150sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg) 150sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg)
151 151
152if (not sys_config_ok) and errcode ~= "run" then 152if (not sys_config_ok) and errcode == "open" then -- file not found, so try alternate file
153 sys_config_file = sys_config_dir.."/config.lua" 153 sys_config_file = sys_config_dir.."/config.lua"
154 sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg) 154 sys_config_ok, err, errcode = persist.load_into_table(sys_config_file, cfg)
155end 155end
156if (not sys_config_ok) and errcode ~= "open" then 156if (not sys_config_ok) and errcode ~= "open" then -- either "load" or "run"; bad config file, bail out with error
157 io.stderr:write(err.."\n") 157 io.stderr:write(err.."\n")
158 os.exit(cfg.errorcodes.CONFIGFILE) 158 os.exit(cfg.errorcodes.CONFIGFILE)
159end 159end