From d820260184bf060b7796d886bf3a9b29864afbe1 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 6 May 2022 10:00:04 +1000 Subject: [PATCH] Support IGs with main not master --- .../fhir/utilities/npm/FilesystemPackageCacheManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java index 49f81fac3..da4d91bc5 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java @@ -529,7 +529,12 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple checkBuildLoaded(); if (ciList.containsKey(id)) { if (branch == null) { - InputStream stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "package.tgz"), false); + InputStream stream; + try { + stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "package.tgz"), false); + } catch (Exception e) { + stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "branches", "main", "package.tgz"), false); + } return new InputStreamWithSrc(stream, Utilities.pathURL(ciList.get(id), "package.tgz"), "current"); } else { InputStream stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "branches", branch, "package.tgz"), false);