Update tools.sh

This commit is contained in:
Fioren
2023-05-15 20:17:48 +07:00
committed by GitHub
parent 9c69f73c07
commit b428cf6828

View File

@@ -1,12 +1,11 @@
dl_gh() { dl_gh() {
for repo in $1 ; do for repo in $1 ; do
asset_urls=$(wget -qO- "https://api.github.com/repos/$2/$repo/releases/$3" \ wget -qO- "https://api.github.com/repos/$2/$repo/releases/$3" \
| jq -r '.assets[] | "\(.browser_download_url) \(.name)"') | jq -r '.assets[] | "\(.browser_download_url) \(.name)"' \
while read -r url names | while read -r url names; do
do
echo "Downloading $names from $url" echo "Downloading $names from $url"
wget -q -O "$names" $url wget -q -O "$names" $url
done <<< "$asset_urls" done
done done
echo "All assets downloaded" echo "All assets downloaded"
} }