Skip to content

Commit

Permalink
retry curl until it succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Nov 5, 2021
1 parent 65b5e12 commit a156570
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/install-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ fi

echo "installer options: ${installer_options[@]}"

curl -o /tmp/install -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
# There is --retry-on-errors, but only newer curl versions support that
until curl -o /tmp/install -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
do
sleep 1
done

cat /tmp/install
chmod +x /tmp/install
sh /tmp/install "${installer_options[@]}"
Expand Down

0 comments on commit a156570

Please sign in to comment.