summaryrefslogtreecommitdiff
path: root/lib/license/management/shell.rb
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-06-05 16:30:19 -0600
committermo khan <mo.khan@gmail.com>2020-06-08 18:24:52 -0600
commit8e206689d9aae60f20ed25ce2c55b1f9a80a8daa (patch)
treed37f47cdbe4acee4aecc827006a811dba5010dd1 /lib/license/management/shell.rb
parent5eef2e4c1a5c28f4e2b8e48e4701dae56264a979 (diff)
Use GOPROXY to test downloading modules for trusted and untrusted TLS endpoints
* Use haproxy to proxy to package registry * Install haproxy in setup script * Add markers for collapsible sections * Move ignored groups setup to prepare_project
Diffstat (limited to 'lib/license/management/shell.rb')
-rw-r--r--lib/license/management/shell.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/license/management/shell.rb b/lib/license/management/shell.rb
index 9868f1e..b24d24e 100644
--- a/lib/license/management/shell.rb
+++ b/lib/license/management/shell.rb
@@ -14,12 +14,12 @@ module License
def execute(command, env: {})
expanded_command = expand(command)
- logger.debug(expanded_command)
-
- stdout, stderr, status = Open3.capture3(env, expanded_command)
-
- record(stdout, stderr, status)
- [stdout, stderr, status]
+ collapsible_section(expanded_command) do
+ logger.debug(expanded_command)
+ stdout, stderr, status = Open3.capture3(env, expanded_command)
+ record(stdout, stderr, status)
+ [stdout, stderr, status]
+ end
end
def sh(command, env: {})
@@ -86,6 +86,14 @@ module License
logger.error(stderr)
end
end
+
+ def collapsible_section(header)
+ id = header.downcase.gsub(/[[:space:]]/, '_').gsub(/[^0-9a-z ]/i, '_')
+ logger.debug("section_start:#{Time.now.to_i}:#{id}\r\e[0K#{header}")
+ yield
+ ensure
+ logger.debug("section_end:#{Time.now.to_i}:#{id}\r\e[0K")
+ end
end
end
end