Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06883356 authored by Christopher Ferris's avatar Christopher Ferris Committed by Android Git Automerger
Browse files

am 4c4db2d8: am ce78cf40: am 6bd0bbd5: Merge "Portable way to color"

* commit '4c4db2d8':
  Portable way to color
parents e82d22f5 4c4db2d8
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ EOF
    T=$(gettop)
    local A
    A=""
    for i in `cat $T/build/envsetup.sh | sed -n "/^[ \t]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
    for i in `cat $T/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
      A="$A $i"
    done
    echo $A
@@ -1431,9 +1431,9 @@ function pez {
    local retval=$?
    if [ $retval -ne 0 ]
    then
        echo -e "\e[0;31mFAILURE\e[00m"
        echo $'\E'"[0;31mFAILURE\e[00m"
    else
        echo -e "\e[0;32mSUCCESS\e[00m"
        echo $'\E'"[0;32mSUCCESS\e[00m"
    fi
    return $retval
}
@@ -1455,9 +1455,9 @@ function make()
    local secs=$(($tdiff % 60))
    local ncolors=$(tput colors 2>/dev/null)
    if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
        color_failed="\e[0;31m"
        color_success="\e[0;32m"
        color_reset="\e[00m"
        color_failed=$'\E'"[0;31m"
        color_success=$'\E'"[0;32m"
        color_reset=$'\E'"[00m"
    else
        color_failed=""
        color_success=""
@@ -1465,9 +1465,9 @@ function make()
    fi
    echo
    if [ $ret -eq 0 ] ; then
        echo -n -e "${color_success}#### make completed successfully "
        echo -n "${color_success}#### make completed successfully "
    else
        echo -n -e "${color_failed}#### make failed to build some targets "
        echo -n "${color_failed}#### make failed to build some targets "
    fi
    if [ $hours -gt 0 ] ; then
        printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs
@@ -1476,7 +1476,7 @@ function make()
    elif [ $secs -gt 0 ] ; then
        printf "(%s seconds)" $secs
    fi
    echo -e " ####${color_reset}"
    echo " ####${color_reset}"
    echo
    return $ret
}