Skip to content

Commit

Permalink
Add --fetch-dependencies override envvar value (#5047)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannescoetzee authored Oct 31, 2024
1 parent 6c169a1 commit 3e05969
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ class AstCreationPass(config: Config, cpg: Cpg, sourcesOverride: Option[List[Str

private def getDependencyList(inputPath: String): List[String] = {
val envVarValue = Option(System.getenv(JavaSrcEnvVar.FetchDependencies.name))
val shouldFetch = if (envVarValue.exists(_.nonEmpty)) {
val shouldFetch = if (envVarValue.contains("no-fetch")) {
logger.info(s"Disabling dependency fetching as envvar is set to \"no-fetch\"")
false
} else if (envVarValue.exists(_.nonEmpty)) {
logger.info(s"Enabling dependency fetching: Environment variable ${JavaSrcEnvVar.FetchDependencies.name} is set")
true
} else if (config.fetchDependencies) {
Expand Down

0 comments on commit 3e05969

Please sign in to comment.