Skip to content

Instantly share code, notes, and snippets.

@cecekpawon
Created July 16, 2019 06:53
Show Gist options
  • Save cecekpawon/92f6219f04c66ce44a8506538feefdc8 to your computer and use it in GitHub Desktop.
Save cecekpawon/92f6219f04c66ce44a8506538feefdc8 to your computer and use it in GitHub Desktop.
Github releases - for Slice - with love
#!/bin/bash
owner=Acidanthera
repo=(AptioFixPkg AppleSupportPkg)
target=RELEASE #DEBUG
for r in "${repo[@]}"
do
json=$(curl -s https://api.github.com/repos/${owner}/${r}/releases/latest)
tag=$(echo "${json}" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
url=($(echo "${json}" | grep '"browser_download_url":' | sed -E 's/.*"([^"]+)".*/\1/'))
for u in "${url[@]}"
do
if [[ "${u}" == *"${target}"* ]]; then
echo "((( ${owner} | ${r} | ${tag} ))): ${u}"
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment