Skip to content

Commit fbd7223

Browse files
committed
Trim and filter empties in arg files
1 parent b433e3c commit fbd7223

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/compiler/scala/tools/nsc/CompilerCommand.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
126126
def expandArg(arg: String): List[String] = {
127127
import java.nio.file.{Files, Paths}
128128
import scala.jdk.CollectionConverters._
129-
def stripComment(s: String) = s.takeWhile(_ != '#')
129+
def stripComment(s: String) = s.takeWhile(_ != '#').trim()
130130
val file = Paths.get(arg.stripPrefix("@"))
131131
if (!Files.exists(file))
132132
throw new java.io.FileNotFoundException(s"argument file $file could not be found")
133-
Files.readAllLines(file).asScala.map(stripComment).toList
133+
Files.readAllLines(file).asScala.map(stripComment).filter(_ != "").toList
134134
}
135135

136136
// override this if you don't want arguments processed here

0 commit comments

Comments
 (0)