Skip to content

Commit

Permalink
Merge pull request udhos#8 from cipress/master
Browse files Browse the repository at this point in the history
support for curl if wget is not available
  • Loading branch information
udhos authored May 25, 2017
2 parents 7778ee2 + 538a422 commit 01d194a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion update-golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ download() {
if [ -f "$abs_filepath" ]; then
msg no need to download - file cached: "$abs_filepath"
else
wget -O "$abs_filepath" "$url" || die could not download using wget from: "$url"
if hash wget 2>/dev/null; then
wget -O "$abs_filepath" "$url" || die could not download using wget from: "$url"
else
curl -o "$abs_filepath" "$url"
fi
fi
else
msg "$abs_url" is local
Expand Down

0 comments on commit 01d194a

Please sign in to comment.