Skip to content

Commit 9a2ad95

Browse files
committed
ota: ci: added another safety check
1 parent 2dddb20 commit 9a2ad95

2 files changed

Lines changed: 12 additions & 17 deletions

File tree

helpers/latest_device.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
git clone https://github.com/RevengeOS-Devices/official_devices official_devices
55

66
cd official_devices
7-
LIST=$(git diff-tree --no-commit-id --name-only -r HEAD)
8-
echo $LIST > temp
9-
sed 's|/.*||' -i temp
7+
git diff-tree --no-commit-id --name-only -r HEAD | sed 's|/.*||' > temp
108
DEVICE=$(cat temp)
9+
for i in $(cat temp); do
10+
if [ "$i" == "maintainers.json" ]; then
11+
DEVICE=maintainers.json
12+
echo $DEVICE
13+
fi
14+
done
1115
cd ..
1216
rm -rf official_devices
1317
echo $DEVICE
14-
export DEVICE

push.sh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,17 @@ source $(pwd)/helpers/push_helpers.sh
66
# Export TARGET_DEVICE from last updated device inside official_devices
77
TARGET_DEVICE=$(bash $(pwd)/helpers/latest_device.sh)
88

9-
# Just a lil safety check
10-
FLAG=$(cat file)
11-
if [ "$FLAG" == "0" ]; then
12-
tg_groupcast "Not pushing, only core files updated."
13-
exit
14-
fi
15-
169
# Abort if TARGET_DEVICE equals to changelog.txt or maintainers.json
1710
if [ "$TARGET_DEVICE" == "maintainers.json" ] || [ "$TARGET_DEVICE" == "changelog.txt" ]; then
1811
tg_groupcast "Only maintainers.json or changelog.txt has been updated. Ignoring."
1912
exit
2013
fi
2114

22-
# Another safety check
23-
if [ "$DEVICE" == "$TARGET_DEVICE" ]; then
24-
echo "Continuing, safety check passed."
25-
else
26-
tg_groupcast "Something's wrong with the script. Device: ${DEVICE}, Target device: ${TARGET_DEVICE}."
27-
exit
15+
# Just a lil safety check
16+
FLAG=$(cat file)
17+
if [ "$FLAG" == "0" ]; then
18+
tg_groupcast "Not pushing, only core files updated."
19+
exit
2820
fi
2921

3022
# Fetch device.json from our github repo

0 commit comments

Comments
 (0)