Skip to content

Commit 2c7bb8c

Browse files
committed
adjust error message when files have been found while extracting
1 parent 8891ae7 commit 2c7bb8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public class AutoBuild {
210210
private final String defaultEncoding;
211211
private ExecutorService threadPool;
212212
private volatile boolean seenCode = false;
213+
private volatile boolean seenFiles = false;
213214
private boolean installDependencies = false;
214215
private int installDependenciesTimeout;
215216
private final VirtualSourceRoot virtualSourceRoot;
@@ -472,7 +473,11 @@ public int run() throws IOException {
472473
shutdownThreadPool();
473474
}
474475
if (!seenCode) {
475-
warn("No JavaScript or TypeScript code found.");
476+
if (seenFiles) {
477+
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
478+
} else {
479+
warn("No JavaScript or TypeScript code found.");
480+
}
476481
return -1;
477482
}
478483
return 0;
@@ -1201,6 +1206,7 @@ private void doExtract(FileExtractor extractor, Path file, ExtractorState state)
12011206
long start = logBeginProcess("Extracting " + file);
12021207
Integer loc = extractor.extract(f, state);
12031208
if (!extractor.getConfig().isExterns() && (loc == null || loc != 0)) seenCode = true;
1209+
if (!extractor.getConfig().isExterns()) seenFiles = true;
12041210
logEndProcess(start, "Done extracting " + file);
12051211
} catch (Throwable t) {
12061212
System.err.println("Exception while extracting " + file + ".");

0 commit comments

Comments
 (0)