Skip to content

Commit

Permalink
fix: try to parse deps
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 23, 2023
1 parent 1d5fd62 commit 123f904
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,23 @@ class WorkerManager(private val workerContext: WorkerContext) {
*
*/
fun init(codeDir: File, language: String) {
val dependencies = ScaAnalyser(object : ScaContext {
override val client: ArchGuardClient = EmptyArchGuardClient()
override val language: String = language
override val path: String = codeDir.absolutePath
}).analyse()

if (dependencies.isEmpty()) {
logger.warn("no dependencies found in $codeDir")
} else {
logger.info("found ${dependencies.size} dependencies in $codeDir")
}
try {
val dependencies = ScaAnalyser(object : ScaContext {
override val client: ArchGuardClient = EmptyArchGuardClient()
override val language: String = language
override val path: String = codeDir.absolutePath
}).analyse()

if (dependencies.isEmpty()) {
logger.warn("no dependencies found in $codeDir")
} else {
logger.info("found ${dependencies.size} dependencies in $codeDir")
}

workerContext.compositionDependency = dependencies
workerContext.compositionDependency = dependencies
} catch (e: Exception) {
logger.error("failed to init dependencies", e)
}
}

/**
Expand Down

0 comments on commit 123f904

Please sign in to comment.