forked from openkylin/platform_build
pez: colored SUCCESS/FAILURE indicator
pez is a new bash function that can be prepended to existing functions or commands to clearly show a colored exit status. Example: $ pez mmm frameworks/base/etc will print all the usual output, and at the end either a green "SUCCESS" line or a red "FAILURE" line. Change-Id: I7e369b0280d6ece16fb0be1895278c26922491fe
This commit is contained in:
parent
24753394b9
commit
f0d08ebd2f
13
envsetup.sh
13
envsetup.sh
|
@ -1236,6 +1236,19 @@ function set_java_home() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Print colored exit condition
|
||||
function pez {
|
||||
$@
|
||||
retval=$?
|
||||
if [ $retval -ne 0 ]
|
||||
then
|
||||
echo -e "\e[0;31mFAILURE\e[00m"
|
||||
else
|
||||
echo -e "\e[0;32mSUCCESS\e[00m"
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
|
||||
if [ "x$SHELL" != "x/bin/bash" ]; then
|
||||
case `ps -o command -p $$` in
|
||||
*bash*)
|
||||
|
|
Loading…
Reference in New Issue