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

Commit 56041e7e authored by LuK1337's avatar LuK1337 Committed by Gerrit Code Review
Browse files

dopush: Add support for OS X

* OS X's sed doesn't have `-r` parameter and requires
different color stripping regex.

Change-Id: I2438f0492b1b564be6b7596fa123fc17eb64b25f
parent 2d14f987
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2206,10 +2206,18 @@ function dopush()
    fi

    # Install: <file>
    if [ `uname` = "Linux" ]; then
        LOC="$(cat $OUT/.log | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | grep '^Install: ' | cut -d ':' -f 2)"
    else
        LOC="$(cat $OUT/.log | sed -E "s/"$'\E'"\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" | grep '^Install: ' | cut -d ':' -f 2)"
    fi

    # Copy: <file>
    if [ `uname` = "Linux" ]; then
        LOC="$LOC $(cat $OUT/.log | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | grep '^Copy: ' | cut -d ':' -f 2)"
    else
        LOC="$LOC $(cat $OUT/.log | sed -E "s/"$'\E'"\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" | grep '^Copy: ' | cut -d ':' -f 2)"
    fi

    # If any files are going to /data, push an octal file permissions reader to device
    if [ -n "$(echo $LOC | egrep '(^|\s)/data')" ]; then