All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.leandroborgesferreira.dagcommand.logic.ChangedModules.kt Maven / Gradle / Ivy

There is a newer version: 1.7.0
Show newest version
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