Skip to content

Commit

Permalink
Merge pull request #2 from eightseventhreethree/get_latest_url
Browse files Browse the repository at this point in the history
Get latest release URL from Jetbrains
  • Loading branch information
nagygergo authored Jan 28, 2018
2 parents 2e36ef0 + 2804244 commit c6c0a8c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jetbrains-toolbox.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
echo -e " \e[94mInstalling Jetbrains Toolbox\e[39m"
echo ""

URL="https://download.jetbrains.com/toolbox/jetbrains-toolbox-1.0.2095.tar.gz"
function getLatestUrl() {
USER_AGENT=('User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36')

FILE=$(basename ${URL})
URL=$(curl 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' -H 'Origin: https://www.jetbrains.com' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.8' -H "${USER_AGENT[@]}" -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://www.jetbrains.com/toolbox/download/' -H 'Connection: keep-alive' -H 'DNT: 1' --compressed | grep -Po '"linux":.*?[^\\]",' | awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g')
echo $URL
}
getLatestUrl

FILE=$(basename ${URL})
DEST=$PWD/$FILE

echo ""
echo -e "\e[94mDownloading Toolbox files \e[39m"
echo ""
Expand Down

0 comments on commit c6c0a8c

Please sign in to comment.