com.github.leandroborgesferreira.dagcommand.logic.ChangedModules.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dag-command Show documentation
Show all versions of dag-command Show documentation
Affected gradle modules by branch
package com.github.leandroborgesferreira.dagcommand.logic
import com.github.leandroborgesferreira.dagcommand.utils.CommandExecutor
fun changedModules(commandExec: CommandExecutor, defaultBranch: String): List =
commandExec.runCommand("git diff $defaultBranch --dirstat=files")
.map(::parseModuleName)
.distinct()
private fun parseModuleName(commandResult: String): String =
commandResult.trimStart()
.split(" ", limit = 2)[1]
.split("/", limit = 2)[0]
© 2015 - 2024 Weber Informatics LLC | Privacy Policy