Skip to content

Commit

Permalink
Fix output format
Browse files Browse the repository at this point in the history
  • Loading branch information
hugohills-regnosys committed Nov 15, 2024
1 parent 3d90e6a commit f98340f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ private TestPackModel writeTestPackSamples(Path resourcesPath, Path inputPath, P
}

private String updateFileExtensionBasedOnOutputFormat(PipelineModel pipelineModel, String fileName) {
if (pipelineModel.getOutputSerialisation() != null) {
String outputFormat = pipelineModel.getOutputSerialisation().getFormat().toString().toLowerCase();
return fileName.substring(0, fileName.lastIndexOf(".")) + "." + outputFormat;
}
return fileName;
String outputFormat = Optional.ofNullable(pipelineModel.getOutputSerialisation())
.map(PipelineModel.Serialisation::getFormat)
.map(PipelineModel.Serialisation.Format::toString)
.orElse("json")
.toLowerCase();
return fileName.substring(0, fileName.lastIndexOf(".")) + "." + outputFormat;
}

private Map<String, List<Path>> filterAndGroupingByTestPackId(Path resourcesPath, Path inputPath, List<Path> inputSamples, Predicate<String> testPackSampleInclusionFilter) {
Expand Down

0 comments on commit f98340f

Please sign in to comment.