Skip to content

Commit

Permalink
collapse multiline command to one line
Browse files Browse the repository at this point in the history
  • Loading branch information
reminia committed Dec 9, 2023
1 parent b525353 commit fc040bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/scala/sbtcurl/CurlPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ object Curl {
try {
val (list, _) = source
.getLines()
// remove empty and comment line
.filter(line => line.nonEmpty && !line.startsWith("#"))
.foldRight[(List[String], List[String])](List(), List()) { case (line, (list1, list2)) =>
val _line = line.dropWhile(_.isWhitespace)
val _line = line.trim.stripSuffix("\\")
if (_line.startsWith("curl")) {
val s = (_line :: list2).mkString(System.lineSeparator())
val s = (_line :: list2).mkString(" ")
(s :: list1) -> List()
} else {
list1 -> (_line :: list2)
Expand Down

0 comments on commit fc040bd

Please sign in to comment.