]> xenbits.xensource.com Git - libvirt.git/commitdiff
ci: jobs.sh: Introduce a quiet version of run_cmd
authorErik Skultety <eskultet@redhat.com>
Tue, 19 Sep 2023 08:46:08 +0000 (10:46 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 19 Sep 2023 11:35:59 +0000 (13:35 +0200)
We've started using the run_cmd helper function to log what kind of
command is being executed as well as actually executing the command.
The problem however is doing I/O redirections for commands which we
don't wish to see any output for whatever reason. Now, if the
redirection is applied at parameter passing to run_cmd it's going to be
applied to the debug print as well. Let's introduce another helper,
run_cmd_quiet which takes care of the I/O redirection and executes the
command completely silently.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ci/jobs.sh

index b52e45cc8ccfb78e5819ee080493f8b5ab3db0d5..8ae3b87228fb441aff8b3b68c3a43686b2ecefdd 100644 (file)
@@ -18,6 +18,11 @@ run_cmd() {
     "$@"
 }
 
+run_cmd_quiet() {
+    printf "\e[32m[RUN COMMAND]: '%s'\e[0m\n" "$*"
+    "$@" 1>/dev/null 2>&1
+}
+
 run_meson_setup() {
     run_cmd meson setup build --error -Dsystem=true $MESON_OPTS $MESON_ARGS || \
     (cat "${GIT_ROOT}/build/meson-logs/meson-log.txt" && exit 1)