Skip to content

Commit 7022dd5

Browse files
maradoSteve Kondik
authored andcommitted
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
1 parent 9a89692 commit 7022dd5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

envsetup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,11 @@ function dopush()
24102410
adb remount &> /dev/null
24112411
24122412
mkdir -p $OUT
2413-
$func $* | tee $OUT/.log
2413+
($func $*|tee $OUT/.log;return ${PIPESTATUS[0]})
2414+
ret=$?;
2415+
if [ $ret -ne 0 ]; then
2416+
rm -f $OUT/.log;return $ret
2417+
fi
24142418
24152419
# Install: <file>
24162420
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)"

0 commit comments

Comments
 (0)