aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-04-12 14:11:02 -0300
committerHisham Muhammad <hisham@gobolinux.org>2013-04-12 14:11:02 -0300
commitdede5ff5a56eb1d2ddb13ca7450e00cd8d6562dd (patch)
treed5f1aa0a9f2f22adf2e39c300fa0fdb3609ffb88
parent4bc14e55b36ec47231b446c0fa7afc3c39173af1 (diff)
downloadluarocks-dede5ff5a56eb1d2ddb13ca7450e00cd8d6562dd.tar.gz
luarocks-dede5ff5a56eb1d2ddb13ca7450e00cd8d6562dd.tar.bz2
luarocks-dede5ff5a56eb1d2ddb13ca7450e00cd8d6562dd.zip
Handle verbosity with a config option (now it can be set through the config file)
-rw-r--r--src/luarocks/fs/lua.lua1
-rw-r--r--src/luarocks/fs/win32/tools.lua9
2 files changed, 3 insertions, 7 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index d6795773..36b33690 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -129,6 +129,7 @@ if lfs_ok then
129-- @return boolean: true if command succeeds (status code 0), false 129-- @return boolean: true if command succeeds (status code 0), false
130-- otherwise. 130-- otherwise.
131function execute_string(cmd) 131function execute_string(cmd)
132 if cfg.verbose then print("Executing: "..cmd) end
132 local code = os.execute(cmd) 133 local code = os.execute(cmd)
133 if code == 0 or code == true then 134 if code == 0 or code == true then
134 return true 135 return true
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua
index e32b8280..eabf125e 100644
--- a/src/luarocks/fs/win32/tools.lua
+++ b/src/luarocks/fs/win32/tools.lua
@@ -4,11 +4,6 @@
4-- used by this module. 4-- used by this module.
5module("luarocks.fs.win32.tools", package.seeall) 5module("luarocks.fs.win32.tools", package.seeall)
6 6
7
8--uncomment following line to make executed commands and results visible
9--TODO: make commandline option
10--local verbose = true
11
12local fs = require("luarocks.fs") 7local fs = require("luarocks.fs")
13local dir = require("luarocks.dir") 8local dir = require("luarocks.dir")
14local cfg = require("luarocks.cfg") 9local cfg = require("luarocks.cfg")
@@ -61,9 +56,9 @@ end
61-- otherwise. 56-- otherwise.
62function execute_string(cmd) 57function execute_string(cmd)
63 cmd = command_at(fs.current_dir(), cmd) 58 cmd = command_at(fs.current_dir(), cmd)
64 if verbose then print("Executing: "..tostring(cmd)) end 59 if cfg.verbose then print("Executing: "..tostring(cmd) end
65 local code = pack(os.execute(cmd)) 60 local code = pack(os.execute(cmd))
66 if verbose then 61 if cfg.verbose then
67 print("Results: "..tostring(code.n)) 62 print("Results: "..tostring(code.n))
68 for i = 1,code.n do 63 for i = 1,code.n do
69 print(" "..tostring(i).." ("..type(code[i]).."): "..tostring(code[i])) 64 print(" "..tostring(i).." ("..type(code[i]).."): "..tostring(code[i]))