Skip to content

Instantly share code, notes, and snippets.

@Surendrajat
Last active August 4, 2018 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Surendrajat/0648457e48da546e25a11240f80bfce7 to your computer and use it in GitHub Desktop.
Save Surendrajat/0648457e48da546e25a11240f80bfce7 to your computer and use it in GitHub Desktop.
#!/bin/bash
user=
pass=
latest_version=TWRP-3.2.3
###### file containing github links for all device trees
file=all.url
curl -u "$user:$pass" -s "https://api.github.com/users/TwrpBuilder/repos?per_page=1000" | grep -w clone_url | grep -o '[^"]\+://.\+.git' > $file
while IFS= read -r line; do
repo="$(echo $line | cut -d / -f5 | cut -d . -f1)"
asset=$(curl -u "$user:$pass" --silent "https://api.github.com/repos/TwrpBuilder/$repo/releases/latest" | jq -r '.assets[0].name')
if [[ ! $asset == $latest_version-* ]]; then
echo $line
fi
done < "$file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment