-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakecrdroid.sh
executable file
·53 lines (44 loc) · 1.63 KB
/
makecrdroid.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
printf "="
printf ">"
for (i=percent;i<100;i++)
printf " "
printf "]\r"
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
}
## Variables
ROM="crdroid"
ROM_DIR=""$HOME"/android/"$ROM""
BUILD_DIR=""$HOME"/android/"$ROM"/out/target/product/beyond2lte/"
## Environment
set -e
cd "$ROM_DIR"
export WITH_MAGISK=true
source "$ROM_DIR/build/envsetup.sh"
## Sync
echo "Syncing latest changes for "$ROM""
repo sync -j60
## Build
echo "Starting "$ROM" For Beyond2lte(S10+)"
lunch lineage_beyond2lte-eng
time mka bacon -j120
## Upload
cd "$BUILD_DIR"
latestbuild=$(ls -t crDroidAndroid-10.0-*-beyond2lte-v6.6.zip | head -n1)
echo "${latestbuild}"
cp_p changelog_beyond2lte.txt /home/zunaidaminenan/S10PlusBuilds/Crdroid/changelog_beyond2lte.txt
cp_p ${latestbuild} /home/zunaidaminenan/S10PlusBuilds/Crdroid/${latest}
rsync -avz --info=progress2 /home/zunaidaminenan/S10PlusBuilds/Crdroid/changelog_beyond2lte.txt [email protected]:/home/frs/project/zunaid-s10plus-builds/S10PlusBuilds/Crdroid/changelog_beyond2lte.txt
rsync -avz --info=progress2 /home/zunaidaminenan/S10PlusBuilds/Crdroid/${latest} [email protected]:/home/frs/project/zunaid-s10plus-builds/S10PlusBuilds/Crdroid/${latest}
echo "The "$ROM" build has been successfully uploaded!"