Skip to content

Commit

Permalink
Strip not wanted endline
Browse files Browse the repository at this point in the history
  • Loading branch information
gianluz committed Jan 26, 2020
1 parent 9ffdd02 commit 0f71d1c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object DangerKotlin {
fun run() {
val dangerDSLPath = readLine()

dangerDSLPath?.removePrefix("danger://dsl/")?.removeNonPrintableChars()?.let {
dangerDSLPath?.removePrefix("danger://dsl/")?.stripEndLine()?.let {
with(DangerFile) {
execute(it, FILE_TMP_OUTPUT_JSON)
}
Expand All @@ -21,6 +21,6 @@ object DangerKotlin {
println("danger-results:/$FILE_TMP_OUTPUT_JSON")
}

private fun String.removeNonPrintableChars() = replace("\\p{C}", "")
private fun String.stripEndLine() = replace("\u007F", "")

}

0 comments on commit 0f71d1c

Please sign in to comment.