Skip to content

Commit 57568d6

Browse files
committed
Reduce calls to bloated tput binary
1 parent 2c3fdbb commit 57568d6

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

heaptrack.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ fi
6161
log "created heaptrack report at $heaptrack_logpath"
6262
log "you can inspect it using this command:"
6363
echo ""
64-
echo " $(tput bold)heaptrack_print ${heaptrack_logpath}.zst | less$(tput sgr0)"
64+
echo " ${WHITE}heaptrack_print ${heaptrack_logpath}.zst | less${RESET}"
6565
echo ""
6666
log "or publish it via http and download locally to inspect with heaptrack gui version:"
6767
echo ""
68-
echo " $(tput bold)cp ${heaptrack_logpath}.zst /var/www/html/tmp/$(tput sgr0)"
68+
echo " ${WHITE}cp ${heaptrack_logpath}.zst /var/www/html/tmp/${RESET}"
6969
echo ""
7070
log "then click here to download https://zillyhuhn.com/tmp/${heaptrack_logpath}.zst"
7171
log "after downloading clean it up using this command:"
7272
echo ""
73-
echo " $(tput bold)rm /var/www/html/tmp/${heaptrack_logpath}.zst$(tput sgr0)"
73+
echo " ${WHITE}rm /var/www/html/tmp/${heaptrack_logpath}.zst${RESET}"
7474
echo ""

lib/include/colors.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22

3+
# resets color and bold property
34
export RESET='\033[0m'
5+
6+
# keeps the color
7+
export BOLD='\033[1m'
8+
49
export RED='\033[0;31m'
510
export GREEN='\033[0;32m'
611
export YELLOW='\033[0;33m'

lib/include/logger.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function _log() {
3939
ts="[$(date '+%F %H:%M:%S')]"
4040
if [ "${LOG_TS:-}" == "1" ]
4141
then
42-
echo -ne "$ts$msg_rich"
42+
echo -ne "${ts}${msg_rich}${RESET}"
4343
else
44-
echo -ne "$msg_rich"
44+
echo -ne "${msg_rich}${RESET}"
4545
fi
4646
_log_to_file "$ts$msg_plain"
4747
}

valgrind.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ then
121121
log "created massif report at $massif_logpath"
122122
log "you can inspect it using this command:"
123123
echo ""
124-
echo " $(tput bold)ms_print $massif_logpath$(tput sgr0)"
124+
echo -e " ${BOLD}ms_print $massif_logpath${RESET}"
125125
echo ""
126126
fi
127127

0 commit comments

Comments
 (0)