Skip to content

Commit

Permalink
Merge pull request #785 from ipedrazas/chrore/swap-wget-curl
Browse files Browse the repository at this point in the history
Swap wget for curl to be consistent with docs
  • Loading branch information
mikkelhegn authored Sep 28, 2022
2 parents b316f47 + c0b2c04 commit 8a2a6d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/downloads/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ while [[ $# -gt 0 ]]; do
done

# Check all required utilities are available
require wget
require curl
require tar
require uname

Expand Down Expand Up @@ -106,7 +106,7 @@ esac

# Check desired version. Default to latest if no desired version was requested
if [[ $VERSION = "" ]]; then
VERSION=$(wget -qO- https://github.com/fermyon/spin/releases | grep 'href="/fermyon/spin/releases/tag/v[0-9]*.[0-9]*.[0-9]*\"' | sed -E 's/.*\/fermyon\/spin\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
VERSION=$(curl -so- https://github.com/fermyon/spin/releases | grep 'href="/fermyon/spin/releases/tag/v[0-9]*.[0-9]*.[0-9]*\"' | sed -E 's/.*\/fermyon\/spin\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
fi

# Constructing download FILE and URL
Expand All @@ -115,7 +115,7 @@ URL="https://github.com/fermyon/spin/releases/download/${VERSION}/${FILE}"

# Download file, exit if not found - e.g. version does not exist
fancy_print 0 "Step 1: Downloading: ${URL}"
wget -q $URL || (fancy_print 1 "The requested file does not exist: ${FILE}"; exit 1)
curl -sOL --fail $URL || (fancy_print 1 "The requested file does not exist: ${FILE}"; exit 1)
fancy_print 0 "Done...\n"

# Decompress the file
Expand Down

0 comments on commit 8a2a6d3

Please sign in to comment.