Skip to content

Commit

Permalink
change the sed expression that strips out formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjn authored Oct 28, 2024
1 parent 5b274eb commit 638ccfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions provision/provision-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 638ccfe

Please sign in to comment.