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

Unverified Commit c25c90aa authored by Marcos Marado's avatar Marcos Marado Committed by Michael Bestas
Browse files

dopush only tries to push if its arg doesn't fail

`dopush mm`, as an example, tried to do mm, ignored its result, and
went to push. Now, it does mm, and if mm exits successfully it
continues to push the results, but if mm fails dopush stops,
returning mm's return code.
This is useful for having things like:
  $ mmp && adb reboot
which now reboot the device weather the changes were pushed or not.
With this patch, the device will only get rebooted if the compilation
succeeds.

Change-Id: I001e3dd83e25a775919adbccbd49914da1e94cde
parent 3c6d0634
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2263,7 +2263,11 @@ function dopush()
    adb remount &> /dev/null

    mkdir -p $OUT
    $func $* | tee $OUT/.log
    ($func $*|tee $OUT/.log;return ${PIPESTATUS[0]})
    ret=$?;
    if [ $ret -ne 0 ]; then
        rm -f $OUT/.log;return $ret
    fi

    # Install: <file>
    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)"