From b1240359dde3c1671e7256b664156834f587134d Mon Sep 17 00:00:00 2001 From: Cole Mickens Date: Wed, 18 Oct 2023 12:14:45 +0200 Subject: [PATCH] main.ts: fixup logic to ensure only one installer url override is set --- src/main.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index f62e57e..9cf6644 100644 --- a/src/main.ts +++ b/src/main.ts @@ -597,25 +597,30 @@ function resolve_nix_installer_url( resolved_nix_installer_url = new URL( `https://install.determinate.systems/nix/branch/${nix_installer_branch}/nix-installer-${platform}?${url_suffix}`, ); - } else if (nix_installer_pr !== null) { + } + if (nix_installer_pr !== null) { num_set += 1; resolved_nix_installer_url = new URL( `https://install.determinate.systems/nix/pr/${nix_installer_pr}/nix-installer-${platform}?${url_suffix}`, ); - } else if (nix_installer_revision !== null) { + } + if (nix_installer_revision !== null) { num_set += 1; resolved_nix_installer_url = new URL( `https://install.determinate.systems/nix/rev/${nix_installer_revision}/nix-installer-${platform}?${url_suffix}`, ); - } else if (nix_installer_tag !== null) { + } + if (nix_installer_tag !== null) { num_set += 1; resolved_nix_installer_url = new URL( `https://install.determinate.systems/nix/tag/${nix_installer_tag}/nix-installer-${platform}?${url_suffix}`, ); - } else if (nix_installer_url !== null) { + } + if (nix_installer_url !== null) { num_set += 1; resolved_nix_installer_url = new URL(nix_installer_url); - } else { + } + if (resolved_nix_installer_url == null) { resolved_nix_installer_url = new URL( `https://install.determinate.systems/nix/nix-installer-${platform}?${url_suffix}`, );