mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-18 22:27:51 +00:00
Shrink boilerplate function
This commit is contained in:
parent
3f8ac03553
commit
17e7677757
4
main.sh
4
main.sh
@ -53,12 +53,10 @@ function _fmt () {
|
||||
color="${color_ok}"
|
||||
fi
|
||||
|
||||
color_reset="\x1b[0m"
|
||||
local color_reset="\x1b[0m"
|
||||
if [[ "${TERM}" != "xterm"* ]] || [ -t 1 ]; then
|
||||
# Don't use colors on pipes or non-recognized terminals
|
||||
color=""
|
||||
color_reset=""
|
||||
color=""; color_reset=""
|
||||
fi
|
||||
echo -e "$(date -u +"%Y-%m-%d %H:%M:%S UTC") ${color}$(printf "[%9s]" ${1})${color_reset}";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user