diff --git a/README.md b/README.md index 77bd8d2..19784c9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repo will allow one to build [ReVanced](https://github.com/revanced/) apps automatically and post it to a telegram channel to access and possibly share the builds with friends. It uses [telegram.sh](https://github.com/fabianonline/telegram.sh) to send messages and [telegram-upload](https://github.com/Nekmo/telegram-upload) to upload files. Make sure that `Java >=17` is installed and selected as default. ## How to use -Just run `./build_revanced (force/clean/experimental)`. Might be a good idea to set it up to run periodically using cron. I currently use the following in a user crontab to run it everyday at 6 AM: +Just run `./build_revanced (force/clean/experimental/checkonly)`. Might be a good idea to set it up to run periodically using cron. I currently use the following in a user crontab to run it everyday at 6 AM: ``` 0 6 * * * ``` diff --git a/build_revanced.sh b/build_revanced.sh index 7847f05..6d2dc90 100755 --- a/build_revanced.sh +++ b/build_revanced.sh @@ -103,6 +103,10 @@ for artifact in $artifacts; do data=$(jq -r ".tools[] | select((.repository == \"$repo\") and (.content_type | contains(\"archive\")))" latest_versions.json) version=$(echo "$data" | jq -r '.version') if [[ $(ver_less_than $version_present $version) == true || ! -f $name || $2 == force ]]; then + if [[ $2 == checkonly ]]; then + echo \[checkonly\] $name has an update \($version_present \-\> $version\) | tee -a build.log + continue + fi echo "Downloading $name" | tee -a build.log [[ $name == microg.apk && -f $name && $2 != force ]] && microg_updated=true # shellcheck disable=SC2086,SC2046 @@ -115,8 +119,12 @@ done [[ ! -f com.google.android.youtube.apk || ! -f com.google.android.apps.youtube.music.apk ]] && flag=true # Exit if no updates happened -if [[ $flag == false && "$2" != "force" ]]; then - echo "Nothing to update" | tee -a build.log +if [[ $flag == false && $2 != force ]]; then + if [[ $2 != checkonly ]]; then + echo "Nothing to update" | tee -a build.log + else + echo "Check-only run complete!" | tee -a build.log + fi exit fi