Skip to content

Commit 758059d

Browse files
author
Jacek Gębal
committed
Add check to see if assets are bundled in API.
1 parent 35cb647 commit 758059d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/org/utplsql/cli/reporters/LocalAssetsCoverageHTMLReporter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ public LocalAssetsCoverageHTMLReporter(String selfType, Object[] attributes) {
2929
public Reporter init(Connection con, CompatibilityProxy compatibilityProxy, ReporterFactory reporterFactory) throws SQLException {
3030
super.init(con, compatibilityProxy, reporterFactory);
3131

32-
if (hasOutputToFile()) {
32+
if (hasOutputToFile() && assetsAreBundled()) {
3333
writeReportAssetsTo(getPhysicalAssetPath());
3434
}
3535

3636
return this;
3737
}
3838

39+
private static boolean assetsAreBundled() {
40+
return CoverageHTMLReporter.class.getResource("/CoverageHTMLReporter") != null;
41+
}
42+
3943
private String getNameOfOutputFile() {
4044
Path outputPath = Paths.get(options.getOutputFileName());
4145
return outputPath.getName(outputPath.getNameCount() - 1).toString();
@@ -51,7 +55,7 @@ private Path getPhysicalAssetPath() {
5155
}
5256

5357
private void setAssetsPathFromOptions() {
54-
if (hasOutputToFile()) {
58+
if (hasOutputToFile() && assetsAreBundled()) {
5559
setAssetsPath(getNameOfOutputFile() + "_assets/");
5660
}
5761
}

0 commit comments

Comments
 (0)