Skip to content

Commit

Permalink
Merge pull request #27 from lf-lang/retries
Browse files Browse the repository at this point in the history
Add retries
  • Loading branch information
lhstrh authored Jan 31, 2025
2 parents 7332c99 + 677d26b commit 00a26ac
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ for tool in "${selected[@]}"; do
cli)
description="CLI tools"
rel="https://api.github.com/repos/lf-lang/lingua-franca/releases/$suffix"
if ! kvp=$(curl -L -s -f -H "Accept: application/vnd.github+json" $rel 2>&1 | grep download_url | grep $os-$arch.tar.gz); then
if ! kvp=$(curl --retry 5 --retry-delay 2 --retry-max-time 30 -L -s -f -H "Accept: application/vnd.github+json" $rel 2>&1 | grep download_url | grep $os-$arch.tar.gz); then
echo "Error: Failed to fetch data from $rel" >&2
exit 1
fi
Expand All @@ -200,7 +200,7 @@ for tool in "${selected[@]}"; do
os_abbr="mac"
fi
rel="https://api.github.com/repos/lf-lang/epoch/releases/$suffix"
if ! kvp=$(curl -L -H "Accept: application/vnd.github+json" $rel 2>&1 | grep "download_url" | grep "$arch" | grep "$os_abbr"); then
if ! kvp=$(curl --retry 5 --retry-delay 2 --retry-max-time 30 -L -H "Accept: application/vnd.github+json" $rel 2>&1 | grep "download_url" | grep "$arch" | grep "$os_abbr"); then
echo "Error: Failed to fetch data from $rel" >&2
exit 1
fi
Expand All @@ -219,7 +219,6 @@ for tool in "${selected[@]}"; do
esac

echo "> Installing the ${kind:-$version} release for $os-$arch of $description..."
echo ""

# Download
cleanup $tool
Expand All @@ -231,8 +230,6 @@ for tool in "${selected[@]}"; do
install $tool
echo " * Removing temporary files"
cleanup $tool

echo ""
done

echo "> Done. Please ensure that $bin is on your PATH."
Expand Down

0 comments on commit 00a26ac

Please sign in to comment.