From 6775a09adb4582f64b09755b2db51aef06e4821d Mon Sep 17 00:00:00 2001 From: dotasek Date: Tue, 5 Nov 2024 09:56:06 -0500 Subject: [PATCH] Make sure codegen directory exists --- .../test/java/org/hl7/fhir/r5/test/profiles/PETests.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/profiles/PETests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/profiles/PETests.java index 088b1a6dd..eed237ad0 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/profiles/PETests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/profiles/PETests.java @@ -51,6 +51,7 @@ import org.hl7.fhir.r5.test.utils.TestPackageLoader; import org.hl7.fhir.r5.test.utils.TestingUtilities; import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.filesystem.ManagedFileAccess; import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; import org.hl7.fhir.utilities.npm.NpmPackage; import org.junit.jupiter.api.Assertions; @@ -390,8 +391,12 @@ public class PETests { public void testGenerate() throws IOException { load(); PECodeGenerator gen = new PECodeGenerator(ctxt); - - gen.setFolder(Utilities.path("[tmp]", "codegen")); + + String codeGenFolder = Utilities.path("[tmp]", "codegen"); + if (!ManagedFileAccess.csfile(codeGenFolder).exists()) { + ManagedFileAccess.csfile(codeGenFolder).mkdirs(); + } + gen.setFolder(codeGenFolder); gen.setExtensionPolicy(ExtensionPolicy.Complexes); gen.setNarrative(false); gen.setMeta(false);