我需要使用 scala 执行脚本。当我使用 ! 执行 Seq 时 换行后的字符串丢失。那就是“Here is the”字符串在新行丢失后更新为 Jira 和字符串的另一部分。据我了解,这是由于!不维护新线。谁能建议我如何解决这个问题?请参阅下面的代码。
import scala.sys.process._
val fileContent: String = """ Here is the
text with
new line """
Seq("/opt/atlassian-cli-2.6.0/atlassian.sh", "jira", "--action", "updateIssue", "--issue", "JIRA-2", "--field", "customfield_10664" ,"--values", fileContent).!