aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2015-11-25 00:09:17 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2015-11-25 00:09:17 +0100
commit60e536fdb410694ece41ce5ac8517ffc4826391c (patch)
treec37376361919c84caf5a678a2eff5fe89efc48ea /src
parentce3ea550e02da88cb3236309655ef890f32a0ed8 (diff)
downloadluarocks-60e536fdb410694ece41ce5ac8517ffc4826391c.tar.gz
luarocks-60e536fdb410694ece41ce5ac8517ffc4826391c.tar.bz2
luarocks-60e536fdb410694ece41ce5ac8517ffc4826391c.zip
fix: bad errormessage and missing quotes
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cfg.lua4
-rw-r--r--src/luarocks/fs/lua.lua6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index e3d6e74b..a22cf121 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -663,7 +663,7 @@ function cfg.init_package_paths()
663end 663end
664 664
665function cfg.which_config() 665function cfg.which_config()
666 return { 666 local ret = {
667 system = { 667 system = {
668 file = sys_config_file or sys_config_file_default, 668 file = sys_config_file or sys_config_file_default,
669 ok = sys_config_ok, 669 ok = sys_config_ok,
@@ -673,6 +673,8 @@ function cfg.which_config()
673 ok = home_config_ok, 673 ok = home_config_ok,
674 } 674 }
675 } 675 }
676 ret.nearest = (ret.user.ok and ret.user.file) or ret.system.file
677 return ret
676end 678end
677 679
678cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch 680cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index 73ae2698..18e6b01a 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -134,10 +134,10 @@ function fs_lua.is_tool_available(tool_cmd, tool_name, arg)
134 arg = arg or "--version" 134 arg = arg or "--version"
135 assert(type(arg) == "string") 135 assert(type(arg) == "string")
136 136
137 if not fs.execute_quiet(tool_cmd, arg) then 137 if not fs.execute_quiet(fs.Q(tool_cmd), arg) then
138 local msg = "'%s' program not found. Make sure %s is installed and is available in your PATH " .. 138 local msg = "'%s' program not found. Make sure %s is installed and is available in your PATH " ..
139 "(or you may want to edit the 'variables.%s' value in file 'config.lua')" 139 "(or you may want to edit the 'variables.%s' value in file '%s')"
140 return nil, msg:format(tool_cmd, tool_name, tool_cmd:upper()) 140 return nil, msg:format(tool_cmd, tool_name, tool_name:upper(), cfg.which_config().nearest)
141 else 141 else
142 return true 142 return true
143 end 143 end