I am trying to grab the download url of latest release from GitHub API page.
I first need to capture all the lines which start with browser_download_url
and further grab the one having linux64
in them.
Target link currently which it should capture - https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
After some research , i tried doing the following -
curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | grep "browser_download_url | grep 'linux64[.]gz' | head -n 1 | cut -d '"' -f 4
But it doesn't seem to work.
Also it doesn't necessarily have to be an edit of my attempt, I don't mind if awk, sed etc are used in answers
Like this:
curl -s 'https://api.github.com/repos/mozilla/geckodriver/releases/latest' |
jq -r '.assets[].browser_download_url' |
grep linux64
https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments