Skip to content

Commit

Permalink
fix download_github function problem with wget
Browse files Browse the repository at this point in the history
  • Loading branch information
Sianglife committed Dec 24, 2022
1 parent 6a016e5 commit d7168b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ function download_github()
# $3 is file name to rename to
{
echo "downloading `basename $3 .zip`:"
curl $curl_options_silent --output /tmp/com.hieplpvip.download.txt "https://github.com/$1/releases/latest"
local url=https://github.com`grep -o -m 1 "/.*$2.*\.zip" /tmp/com.hieplpvip.download.txt`
local jsonink="https://api.github.com/repos/$1/releases/latest"
curl $curl_options_silent --output /tmp/com.hieplpvip.download.txt "$jsonink"
local url=`grep "browser_download_url" /tmp/com.hieplpvip.download.txt | cut -d : -f 2,3 | tr -d \"|grep RELEASE`
echo $url
curl $curl_options --output "$3" "$url"
wget -O $3 $url
rm /tmp/com.hieplpvip.download.txt
echo
}
Expand Down

1 comment on commit d7168b7

@Sianglife
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix download script problems with wget

Please sign in to comment.