From 783053eda638fe1fab03479d925f89f1d41c3755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Mon, 1 Nov 2021 12:04:45 -0600 Subject: [PATCH] Resilient installation --- lib/install-nix.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/install-nix.sh b/lib/install-nix.sh index 9787881..2e5adeb 100755 --- a/lib/install-nix.sh +++ b/lib/install-nix.sh @@ -45,7 +45,15 @@ if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then fi echo "installer options: ${installer_options[@]}" -sh <(curl --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}") "${installer_options[@]}" + +# 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 + +chmod +x /tmp/install +sh /tmp/install "${installer_options[@]}" if [[ $OSTYPE =~ darwin ]]; then # macOS needs certificates hints