Commit a777b2fc authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-sh-functions: print distr name/version in every error message

parent 5192bf9d
...@@ -367,16 +367,21 @@ message() ...@@ -367,16 +367,21 @@ message()
echog "$*" echog "$*"
} }
# Print error message and stop the program
fatal() __promo_message()
{ {
local PROMOMESSAGE="$EPMPROMOMESSAGE" local PROMOMESSAGE="$EPMPROMOMESSAGE"
[ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)" [ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss this problem (epm $EPMVERSION on $DISTRNAME/$DISTRVERSION) in Telegram: https://t.me/useepm)"
echo "$PROMOMESSAGE"
}
# Print error message and stop the program
fatal()
{
set_color $RED >&2 set_color $RED >&2
echog -n "ERROR: " >&2 echog -n "ERROR: " >&2
restore_color >&2 restore_color >&2
echog "$* $PROMOMESSAGE" >&2 echog "$* $(__promo_message)" >&2
# [ "$TERM" = "screen" ] && echo "(screen detected: waiting ten seconds to exit ...)" >&2 && sleep 10 # [ "$TERM" = "screen" ] && echo "(screen detected: waiting ten seconds to exit ...)" >&2 && sleep 10
exit 1 exit 1
} }
...@@ -384,13 +389,10 @@ fatal() ...@@ -384,13 +389,10 @@ fatal()
# Print error message and stop the program, skippimg translate # Print error message and stop the program, skippimg translate
fixme() fixme()
{ {
local PROMOMESSAGE="$EPMPROMOMESSAGE"
[ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)"
set_color $RED >&2 set_color $RED >&2
echo -n "ERROR: " >&2 echo -n "ERROR: " >&2
restore_color >&2 restore_color >&2
echo "$* $PROMOMESSAGE" >&2 echog "$* $(__promo_message)" >&2
# [ "$TERM" = "screen" ] && echo "(screen detected: waiting ten seconds to exit ...)" >&2 && sleep 10 # [ "$TERM" = "screen" ] && echo "(screen detected: waiting ten seconds to exit ...)" >&2 && sleep 10
exit 1 exit 1
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment