From 638ccfe1a7120c4d02e06d1841bdc9858097f202 Mon Sep 17 00:00:00 2001 From: Tom J Nowell Date: Mon, 28 Oct 2024 18:22:01 +0000 Subject: [PATCH] change the sed expression that strips out formatting --- provision/provision-helpers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/provision/provision-helpers.sh b/provision/provision-helpers.sh index 967735c42..f0021d374 100755 --- a/provision/provision-helpers.sh +++ b/provision/provision-helpers.sh @@ -177,11 +177,11 @@ function log_to_file() { exec 2>&7 # pipe to file if [[ "${1}" == "provisioner-main" ]]; then - exec > >( tee -a "${logfile}" | sed -r "s/\x1B\[[0-9;]*[mK]//g" ) # main provisioner outputs everything + exec > >( tee -a "${logfile}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" ) # main provisioner outputs everything else - exec > >( tee -a "${logfile}" | sed -r "s/\x1B\[[0-9;]*[mK]//g" >/dev/null ) # others, only stderr + exec > >( tee -a "${logfile}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" >/dev/null ) # others, only stderr fi - exec 2> >( tee -a "${logfile}" | sed -r "s/\x1B\[[0-9;]*[mK]//g" >&2 ) + exec 2> >( tee -a "${logfile}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" >&2 ) VVV_CURRENT_LOG_FILE="${logfile}" } export -f log_to_file