diff options
author | Chirayu Desai <cdesai@cyanogenmod.org> | 2012-12-26 10:53:58 +0530 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 16:12:08 -0700 |
commit | 6dadb57db2193f7c1e2d69e339e44bec72c889bc (patch) | |
tree | b6b51394e525cb623347c1cb150be351c3506f70 /envsetup.sh | |
parent | 7bef61f8e3f8c53050517ae5b3e2dd910217edae (diff) | |
download | build-6dadb57db2193f7c1e2d69e339e44bec72c889bc.zip build-6dadb57db2193f7c1e2d69e339e44bec72c889bc.tar.gz build-6dadb57db2193f7c1e2d69e339e44bec72c889bc.tar.bz2 |
envsetup: push to connected device only if it is $CM_BUILD
Change-Id: Icce057cb31d6fbc9abb0292311c88c32fea3540c
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh index 9ce3c65..22a4c91 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -725,6 +725,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 @@ -756,6 +758,9 @@ EOF return 1 fi return $? + else + echo "The connected device does not appear to be $CM_BUILD, run away!" + fi } function omnom @@ -1995,6 +2000,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 @@ -2033,6 +2040,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' |