diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java index e2abec238..2ab1a3389 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java @@ -200,7 +200,7 @@ public class NpmPackage { File dir = new File(path); for (File f : dir.listFiles()) { - if (!Utilities.existsInList(f.getName(), ".git", ".svn") && !Utilities.existsInList(f.getName(), exemptions)) { + if (!isInternalExemptFile(f) && !Utilities.existsInList(f.getName(), exemptions)) { if (f.isDirectory()) { String d = f.getName(); if (!d.equals("package")) { @@ -227,6 +227,10 @@ public class NpmPackage { } } + public static boolean isInternalExemptFile(File f) { + return Utilities.existsInList(f.getName(), ".git", ".svn") || Utilities.existsInList(f.getName(), "package-list.json"); + } + private static void loadSubFolders(NpmPackage res, String rootPath, File dir) throws IOException { for (File f : dir.listFiles()) { if (f.isDirectory()) { @@ -684,7 +688,7 @@ public class NpmPackage { for (NpmPackageFolder folder : folders.values()) { String n = folder.name; - if (!"package".equals(n)) { + if (!"package".equals(n) && !(n.startsWith("package/") || n.startsWith("package\\"))) { n = "package/"+n; } NpmPackageIndexBuilder indexer = new NpmPackageIndexBuilder(); @@ -828,7 +832,7 @@ public class NpmPackage { NpmPackageFolder pf = folders.get(folder); String p = folder.contains("$") ? path : Utilities.path(path, folder); for (File f : new File(p).listFiles()) { - if (!f.isDirectory()) { + if (!f.isDirectory() && !isInternalExemptFile(f)) { pf.getContent().put(f.getName(), TextFile.fileToBytes(f)); } }