Skip to content

Commit

Permalink
Merge pull request #3 from wandera/initial
Browse files Browse the repository at this point in the history
Fix install script
  • Loading branch information
coufalja authored Aug 10, 2022
2 parents e9acb50 + 6666ec0 commit 882ec94
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ checksum_url="https://github.com/wandera/helm-github/releases/download/v${versio
mkdir -p "bin"
mkdir -p "releases/v${version}"
binary_filename="releases/v${version}.tar.gz"
checksums_filename="releases/v${version}_checksums.txt"
checksum_filename="releases/v${version}_checksum.txt"

# Download binary and checksums files.
(
if command -v curl >/dev/null 2>&1; then
curl -sSL "${binary_url}" -o "${binary_filename}"
curl -sSL "${checksum_url}" -o "${checksums_filename}"
curl -sSL "${checksum_url}" -o "${checksum_filename}"
elif command -v wget >/dev/null 2>&1; then
wget -q "${binary_url}" -O "${binary_filename}"
wget -q "${checksum_url}" -O "${checksums_filename}"
wget -q "${checksum_url}" -O "${checksum_filename}"
else
echo "ERROR: no curl or wget found to download files." >/dev/stderr
fi
Expand All @@ -72,16 +72,16 @@ checksums_filename="releases/v${version}_checksums.txt"
(
if command -v sha256sum >/dev/null 2>&1; then
checksum=$(sha256sum "${binary_filename}" | awk '{ print $1 }')
validate_checksum "${checksum}" "${checksums_filename}"
validate_checksum "${checksum}" "${checksum_filename}"
elif command -v openssl >/dev/null 2>&1; then
checksum=$(openssl dgst -sha256 "${binary_filename}" | awk '{ print $2 }')
validate_checksum "${checksum}" "${checksums_filename}"
validate_checksum "${checksum}" "${checksum_filename}"
else
echo "WARNING: no tool found to verify checksum" >/dev/stderr
fi
)

# Unpack the binary.
tar xzf "${binary_filename}" -C "releases/v${version}"
mv "releases/v${version}/bin/helms3" "bin/helms3"
mv "releases/v${version}/bin/helmgithub" "bin/helmgithub"
exit 0

0 comments on commit 882ec94

Please sign in to comment.