mirror of
https://github.com/sbt/sbt.git
synced 2026-08-22 06:07:24 +02:00
Merge pull request #2025 from PanAeon/panaeon/fix-history
Prevent history command(s) from going into an infinite loop
This commit is contained in:
@@ -61,7 +61,7 @@ object HistoryCommands {
|
|||||||
|
|
||||||
def execute(f: History => Option[String]): History => Option[List[String]] = (h: History) =>
|
def execute(f: History => Option[String]): History => Option[List[String]] = (h: History) =>
|
||||||
{
|
{
|
||||||
val command = f(h)
|
val command = f(h).filterNot(_.startsWith(Start))
|
||||||
val lines = h.lines.toArray
|
val lines = h.lines.toArray
|
||||||
command.foreach(lines(lines.length - 1) = _)
|
command.foreach(lines(lines.length - 1) = _)
|
||||||
h.path foreach { h => IO.writeLines(h, lines) }
|
h.path foreach { h => IO.writeLines(h, lines) }
|
||||||
|
|||||||
Reference in New Issue
Block a user