From 0717ab87b524240bf50f3ab325041052d251519b Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Wed, 17 Apr 2019 13:20:25 +0000 Subject: [PATCH] Raise error when /e/ failed to be installed --- install-e.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install-e.sh b/install-e.sh index 7904d28..9f0fe3d 100755 --- a/install-e.sh +++ b/install-e.sh @@ -22,6 +22,8 @@ # Exit status # - 0 : /e/ installed # - 1 : Problems occurred (adb returns only 1 if an error occurs) +# - 2 : Problems occurred during file transfer +# - 3 : Problems occurred /e/ installation # - 101 : DEVICE_ID missing # - 102 : E_ARCHIVE_PATH missing @@ -43,8 +45,13 @@ adb -s ${DEVICE_ID} shell twrp wipe system adb -s ${DEVICE_ID} shell twrp wipe cache adb -s ${DEVICE_ID} shell twrp wipe data adb -s ${DEVICE_ID} push ${E_ARCHIVE_PATH} /sdcard + +if [ $? != 0 ] ; then exit 2 ; fi + adb -s ${DEVICE_ID} shell twrp install /sdcard/${E_IMAGE} +if [ $? != 0 ] ; then exit 3 ; fi + sleep 1 adb -s ${DEVICE_ID} shell rm /sdcard/${E_IMAGE} -- GitLab