diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2013-04-12 14:11:02 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-04-12 14:11:02 -0300 |
commit | dede5ff5a56eb1d2ddb13ca7450e00cd8d6562dd (patch) | |
tree | d5f1aa0a9f2f22adf2e39c300fa0fdb3609ffb88 | |
parent | 4bc14e55b36ec47231b446c0fa7afc3c39173af1 (diff) | |
download | luarocks-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.lua | 1 | ||||
-rw-r--r-- | src/luarocks/fs/win32/tools.lua | 9 |
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. |
131 | function execute_string(cmd) | 131 | function 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. |
5 | module("luarocks.fs.win32.tools", package.seeall) | 5 | module("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 | |||
12 | local fs = require("luarocks.fs") | 7 | local fs = require("luarocks.fs") |
13 | local dir = require("luarocks.dir") | 8 | local dir = require("luarocks.dir") |
14 | local cfg = require("luarocks.cfg") | 9 | local cfg = require("luarocks.cfg") |
@@ -61,9 +56,9 @@ end | |||
61 | -- otherwise. | 56 | -- otherwise. |
62 | function execute_string(cmd) | 57 | function 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])) |