Skip to content
Permalink
Browse files

ListLicensesCommand: Allow overriding the repository config

As the output of this command can be affected by the entries of the
repository configuration it can be useful to override those entries.

Signed-off-by: Frank Viernau <frank.viernau@here.com>
  • Loading branch information...
fviernau committed Oct 7, 2019
1 parent 7d97def commit c1a202908a9a3ba90c66366385c70f9be905c9bf
Showing with 13 additions and 1 deletion.
  1. +13 −1 helper-cli/src/main/kotlin/commands/ListLicensesCommand.kt
@@ -110,8 +110,20 @@ internal class ListLicensesCommand : CommandWithHelp() {
)
private var applyLicenseFindingCurations: Boolean = false

@Parameter(
names = ["--repository-configuration-file"],
required = false,
order = PARAMETER_ORDER_OPTIONAL,
description = "Override the repository configuration contained in the ORT result."
)
private var repositoryConfigurationFile: File? = null

override fun runCommand(jc: JCommander): Int {
val ortResult = ortResultFile.readValue<OrtResult>()
var ortResult = ortResultFile.readValue<OrtResult>()
repositoryConfigurationFile?.let {
ortResult = ortResult.replaceConfig(it.readValue())
}

val sourcesDir = sourceCodeDir ?: ortResult.fetchScannedSources(packageId)
val violatedRulesByLicense = ortResult.getViolatedRulesByLicense(packageId, Severity.ERROR)

0 comments on commit c1a2029

Please sign in to comment.
You can’t perform that action at this time.