forked from syphyr/cm_build_scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
update_web_twrp
executable file
·41 lines (34 loc) · 894 Bytes
/
update_web_twrp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
## Root of CM project directory
PROJECT_DIR=~/android/system/android-6.0
## Changelog location
CHANGE_FILE=~/android/changelog-twrp.html
## Device name
ANDROID_DEVICE=v500
## End Edit
OUTDIR=$PROJECT_DIR/out/target/product/$ANDROID_DEVICE
## Find file name of ROM and set variable
cd "$OUTDIR"
FILE=$(ls recovery.img)
NOW=$(date +%Y-%m-%d)
## Check if ROM exists before proceding
if [ ! -e "$FILE" ]; then
echo "Build Failed!"
if [ -e `which send_mail_twrp` ]; then
echo ""
echo "Automatic email notification sent for failed build!"
SUBJECT="TWRP Build Failed on $NOW"
send_mail_twrp "$SUBJECT"
fi
exit
fi
echo "Build Successful!"
if [ -e `which send_mail_twrp` ]; then
echo ""
echo "Automatic email notification sent for successful build."
SUBJECT="Build Successful for TWRP on $NOW"
send_mail_twrp "$SUBJECT"
fi
echo ""
echo "Done."
echo ""