From 968e96378d32d5be53ce169a3b1bf386fee538fd Mon Sep 17 00:00:00 2001 From: Ignacio BurgueƱo Date: Mon, 20 Apr 2015 11:59:56 -0300 Subject: Redact api tokens when using --verbose flag fixes #358 --- src/luarocks/fs.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/fs.lua b/src/luarocks/fs.lua index 72e11c09..3ecdfacd 100644 --- a/src/luarocks/fs.lua +++ b/src/luarocks/fs.lua @@ -31,7 +31,8 @@ fs.verbose = function() -- patch io.popen and os.execute to display commands old_exec = os.execute os.execute = function(cmd) - print("\nos.execute: ", cmd) + -- redact api keys if present + print("\nos.execute: ", cmd:gsub("(/api/[^/]+/)([^/]+)/", function(cap, key) return cap.."/" end)) local code = pack(old_exec(cmd)) print("Results: "..tostring(code.n)) for i = 1,code.n do -- cgit v1.2.3-55-g6feb