dev-env/bin/messages
2025-05-25 22:21:05 +02:00

39 lines
569 B
Plaintext

ANSI_OPEN="\033["
function resetcolors {
echo -n -e "${ANSI_OPEN}0m"
}
function importantmsg {
echo -e "${ANSI_OPEN}96m$1"
resetcolors
}
function errormsg {
echo -e "${ANSI_OPEN}91m$1"
resetcolors
}
function infomsg {
echo -e "${ANSI_OPEN}0m$1"
resetcolors
}
function successmsg {
echo -e "${ANSI_OPEN}92m$1"
resetcolors
}
function warnmsg {
echo -e "${ANSI_OPEN}93m$1"
resetcolors
}
function hasNewLine {
test "$(tail -c 1 "$1" | wc -l)" -eq 0 && echo "NO" || echo "YES"
}
function indent {
sed 's/^/ /';
}