Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Add check to see if assets are bundled in API.
  • Loading branch information
Jacek Gębal committed Apr 23, 2026
commit 758059d3d81e10830be2bfad850211032a190ae5
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ public LocalAssetsCoverageHTMLReporter(String selfType, Object[] attributes) {
public Reporter init(Connection con, CompatibilityProxy compatibilityProxy, ReporterFactory reporterFactory) throws SQLException {
super.init(con, compatibilityProxy, reporterFactory);

if (hasOutputToFile()) {
if (hasOutputToFile() && assetsAreBundled()) {
writeReportAssetsTo(getPhysicalAssetPath());
}

return this;
}

private static boolean assetsAreBundled() {
return CoverageHTMLReporter.class.getResource("/CoverageHTMLReporter") != null;
}

private String getNameOfOutputFile() {
Path outputPath = Paths.get(options.getOutputFileName());
return outputPath.getName(outputPath.getNameCount() - 1).toString();
Expand All @@ -51,7 +55,7 @@ private Path getPhysicalAssetPath() {
}

private void setAssetsPathFromOptions() {
if (hasOutputToFile()) {
if (hasOutputToFile() && assetsAreBundled()) {
setAssetsPath(getNameOfOutputFile() + "_assets/");
}
}
Expand Down