Display errors on stderr

This commit is contained in:
Jérôme Petazzoni
2016-04-01 23:20:59 +02:00
parent 599e344340
commit 884d0507c2

View File

@@ -1,10 +1,9 @@
die () {
if [ -z "$1" ]; then
exit 1
if [ -n "$1" ]; then
>&2 echo -n $(tput setaf 1)
>&2 echo -e "$1"
>&2 echo -n $(tput sgr0)
fi
echo -n $(tput setaf 1)
echo -e "$1"
echo -n $(tput sgr0)
exit 1
}