-
Notifications
You must be signed in to change notification settings - Fork 3
/
update.sh
executable file
·48 lines (40 loc) · 1.4 KB
/
update.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
#!/bin/bash
set -e
[ -f .gitauth ] && source .gitauth
for cmd in curl jq sed git; do
[ -z "$(command -v $cmd)" ] && echo "missing $cmd" && exit 1
done
source version.sh
REVANCED_PATCHES_TAG=$(curl -s https://api.github.com/repos/revanced/revanced-patches/releases/latest | jq -r '.tag_name')
if [ "$REVANCED_PATCHES" != "$REVANCED_PATCHES_TAG" ]; then
(
git submodule update --checkout
cd revanced-patches
git fetch --all --quiet
git checkout "$REVANCED_PATCHES_TAG"
)
sed -i "s/^REVANCED_PATCHES=.*$/REVANCED_PATCHES=\"$REVANCED_PATCHES_TAG\"/" version.sh
echo "Updated REVANCED_PATCHES from $REVANCED_PATCHES to $REVANCED_PATCHES_TAG"
else
echo "No update for REVANCED_PATCHES $REVANCED_PATCHES found"
fi
REVANCED_CLI_TAG=$(curl -s https://api.github.com/repos/revanced/revanced-cli/releases/latest | jq -r '.tag_name')
if [ "$REVANCED_CLI" != "$REVANCED_CLI_TAG" ]; then
(
git submodule update --checkout
cd revanced-cli
git fetch --all --quiet
git checkout "$REVANCED_CLI_TAG"
)
sed -i "s/^REVANCED_CLI=.*$/REVANCED_CLI=\"$REVANCED_CLI_TAG\"/" version.sh
echo "Updated REVANCED_CLI from $REVANCED_CLI to $REVANCED_CLI_TAG"
else
echo "No update for REVANCED_CLI $REVANCED_CLI found"
fi
echo
source version.sh
cat <<EOF
update ReVanced
* revanced-cli \`$REVANCED_CLI\`
* revanced-patches \`$REVANCED_PATCHES\`
EOF