From eea6c3d780a2a3c4e1f9827b537015fa04cde126 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 16 Aug 2024 12:05:59 +0200 Subject: [PATCH] improvement: Don't allow empty sbtScript setting --- .../scala/scala/meta/internal/builds/SbtBuildTool.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metals/src/main/scala/scala/meta/internal/builds/SbtBuildTool.scala b/metals/src/main/scala/scala/meta/internal/builds/SbtBuildTool.scala index 162ed3a7b0b..53a8e6f43e5 100644 --- a/metals/src/main/scala/scala/meta/internal/builds/SbtBuildTool.scala +++ b/metals/src/main/scala/scala/meta/internal/builds/SbtBuildTool.scala @@ -115,12 +115,12 @@ case class SbtBuildTool( workspace: AbsolutePath, sbtLauncherOutDir: Path, ): List[String] = { - val sbtScript = userConfig().sbtScript.orElse(findSbtInPath()) + val sbtScript = userConfig().sbtScript.orElse(findSbtInPath()).map(_.trim()) sbtScript match { - case Some(script) => + case Some(script) if script.nonEmpty => script :: sbtArgs - case None => + case _ => val javaArgs = List[String]( JavaBinary(userConfig().javaHome), "-Djline.terminal=jline.UnsupportedTerminal",