diff --git a/src/main/scala/com/lightbend/tools/ClocPlugin.scala b/src/main/scala/com/lightbend/tools/ClocPlugin.scala index 684b17a..934a35b 100644 --- a/src/main/scala/com/lightbend/tools/ClocPlugin.scala +++ b/src/main/scala/com/lightbend/tools/ClocPlugin.scala @@ -45,13 +45,13 @@ object ClocRunner { val command = Seq("cloc", "--progress-rate=0", "--quiet", "--csv") def countLines(files: Iterable[File]): Int = try sys.process.Process(command ++ files.map(_.toString)) - .!! - // JDK 11: work around https://github.com/scala/bug/issues/11125 - // without incurring a deprecation warning. was: .lines - .linesWithSeparators.map(_.stripLineEnd) - .map(_.split(',')) - .collectFirst { case Array(_, "Scala", _, _, n) => n.toInt } - .getOrElse(0) + .!! + // JDK 11: work around https://github.com/scala/bug/issues/11125 + // without incurring a deprecation warning. was: .lines + .linesWithSeparators.map(_.stripLineEnd) + .map(_.split(',')) + .collectFirst { case Array(_, "Scala", _, _, n) => n.toInt } + .getOrElse(0) catch { case e: java.io.IOException => Console.err.println(e.getMessage)