mirror of https://github.com/sbt/sbt.git
Merge pull request #8447 from Francluob/fix/8344-batch-mode-load-failed-prompt
[2.x] fix: Skips interactive prompt in batch mode when project loading
This commit is contained in:
commit
df90cb967c
|
|
@ -869,6 +869,10 @@ object BuiltinCommands {
|
||||||
|
|
||||||
@tailrec
|
@tailrec
|
||||||
private def doLoadFailed(s: State, loadArg: String): State = {
|
private def doLoadFailed(s: State, loadArg: String): State = {
|
||||||
|
// In batch mode, exit with failure to avoid infinite retry loops on persistent errors
|
||||||
|
if (ITerminal.console.prompt == Prompt.Batch) {
|
||||||
|
s.exit(ok = false)
|
||||||
|
} else {
|
||||||
s.log.warn("Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)")
|
s.log.warn("Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)")
|
||||||
val result: Int =
|
val result: Int =
|
||||||
try
|
try
|
||||||
|
|
@ -890,6 +894,7 @@ object BuiltinCommands {
|
||||||
case c => println(s"Invalid response: '$c'"); doLoadFailed(s, loadArg)
|
case c => println(s"Invalid response: '$c'"); doLoadFailed(s, loadArg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def loadProjectCommands(arg: String): List[String] =
|
def loadProjectCommands(arg: String): List[String] =
|
||||||
StashOnFailure ::
|
StashOnFailure ::
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue