20 lines
477 B
Bash
Executable File
20 lines
477 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
API='https://api.github.com'
|
|
CONTENT_TYPE='"application/vnd.android.package-archive"'
|
|
|
|
function get_urls() {
|
|
local repo="$1"
|
|
|
|
curl -sSL "$API/repos/$repo/releases/latest" | \
|
|
jq -r ".assets | select(.[].content_type == $CONTENT_TYPE) | .[].browser_download_url"
|
|
}
|
|
|
|
function get_repo_name_from_url() {
|
|
grep -Po '(?<=github.com/)[[:alnum:]]+/[[:alnum:]]+' <<< "$1"
|
|
}
|
|
|
|
for repo in "$@"; do
|
|
get_urls "$(get_repo_name_from_url "$repo")"
|
|
done
|