From fdc7dc5bebcced20d13b3e0630352990a0aaa039 Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Wed, 26 Dec 2012 10:53:58 +0530 Subject: envsetup: push to connected device only if it is $CM_BUILD Change-Id: Icce057cb31d6fbc9abb0292311c88c32fea3540c --- envsetup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 15faab9..a885643 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -672,6 +672,8 @@ function eat() done echo "Device Found.." fi + if (adb shell cat /system/build.prop | grep -q "ro.cm.device=$CM_BUILD"); + then # if adbd isn't root we can't write to /cache/recovery/ adb root sleep 1 @@ -694,6 +696,9 @@ EOF return 1 fi return $? + else + echo "The connected device does not appear to be $CM_BUILD, run away!" + fi } function omnom @@ -1754,6 +1759,8 @@ function dopush() echo "Device Found." fi + if (adb shell cat /system/build.prop | grep -q "ro.cm.device=$CM_BUILD"); + then adb root &> /dev/null sleep 0.3 adb wait-for-device &> /dev/null @@ -1792,6 +1799,9 @@ function dopush() done rm -f $OUT/.log return 0 + else + echo "The connected device does not appear to be $CM_BUILD, run away!" + fi } alias mmp='dopush mm' -- cgit v1.1