mirror of https://github.com/sbt/sbt.git
Merge pull request #5877 from eatkins/shutdown-interrupt
Catch interrupted exception in shell
This commit is contained in:
commit
56cca22baf
|
|
@ -1041,17 +1041,19 @@ object BuiltinCommands {
|
||||||
.extract(s1)
|
.extract(s1)
|
||||||
.getOpt(Keys.minForcegcInterval)
|
.getOpt(Keys.minForcegcInterval)
|
||||||
.getOrElse(GCUtil.defaultMinForcegcInterval)
|
.getOrElse(GCUtil.defaultMinForcegcInterval)
|
||||||
val exec: Exec = getExec(s1, minGCInterval)
|
try {
|
||||||
val newState = s1
|
val exec: Exec = getExec(s1, minGCInterval)
|
||||||
.copy(
|
val newState = s1
|
||||||
onFailure = Some(Exec(Shell, None)),
|
.copy(
|
||||||
remainingCommands = exec +: Exec(Shell, None) +: s1.remainingCommands
|
onFailure = Some(Exec(Shell, None)),
|
||||||
)
|
remainingCommands = exec +: Exec(Shell, None) +: s1.remainingCommands
|
||||||
.setInteractive(true)
|
)
|
||||||
val res =
|
.setInteractive(true)
|
||||||
if (exec.commandLine.trim.isEmpty) newState
|
val res =
|
||||||
else newState.clearGlobalLog
|
if (exec.commandLine.trim.isEmpty) newState
|
||||||
res
|
else newState.clearGlobalLog
|
||||||
|
res
|
||||||
|
} catch { case _: InterruptedException => s1.exit(true) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue