mirror of https://github.com/sbt/sbt.git
Prevent history command(s) from going into an infinite loop [1562]
This commit is contained in:
parent
f334d76f70
commit
54081fb4e4
|
|
@ -0,0 +1,3 @@
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- Prevent history command(s) from going into an infinite loop [#1562][1562] by [@PanAeon][@PanAeon]
|
||||||
|
|
@ -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) }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue