diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index 416fa237e97e..f5e998398f52 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -489,23 +489,21 @@ public int run() throws IOException { diagnosticsToClose.forEach(DiagnosticWriter::close); } - // Fail extraction if no relevant files were found. - boolean seenRelevantFiles = EnvironmentVariables.isActionsExtractor() - ? seenFiles // assume all files are relevant for Actions extractor - : hasSeenCode(); - if (!seenRelevantFiles) { + if (!hasSeenCode()) { if (seenFiles) { warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors."); } else { warn("No JavaScript or TypeScript code found."); } - // Ensuring that the finalize steps detects that no code was seen. - // This is necessary to ensure we don't produce an overlay-base database without externs. + // ensuring that the finalize steps detects that no code was seen. Path srcFolder = Paths.get(EnvironmentVariables.getWipDatabase(), "src"); try { - FileUtil8.recursiveDelete(srcFolder); + // Non-recursive delete because "src/" should be empty. + FileUtil8.delete(srcFolder); } catch (NoSuchFileException e) { Exceptions.ignore(e, "the directory did not exist"); + } catch (DirectoryNotEmptyException e) { + Exceptions.ignore(e, "just leave the directory if it is not empty"); } return 0; } diff --git a/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java b/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java index f2ac4227589f..39dfa70b285b 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java +++ b/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java @@ -18,9 +18,6 @@ public class EnvironmentVariables { public static final String CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR = "CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE"; - public static final String CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR = - "CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE"; - public static final String CODEQL_DIST_ENV_VAR = "CODEQL_DIST"; /** @@ -97,8 +94,4 @@ public static String getCodeQLDist() { public static String getWipDatabase() { return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR); } - - public static boolean isActionsExtractor() { - return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR) != null; - } } diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index d8d53ef1c7ef..1ee1c8c78150 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -23,4 +23,3 @@ dataExtensions: - semmle/javascript/security/domains/**/*.model.yml - ext/*.model.yml warnOnImplicitThis: true -compileForOverlayEval: true