mirror of https://github.com/sbt/sbt.git
Rename --close-io-streams to --detach-stdio
This commit is contained in:
parent
bba3d08aac
commit
d24cd2b3f7
|
|
@ -212,7 +212,7 @@ $AliasCommand name=
|
|||
"Provides an interactive prompt from which commands can be run on a server."
|
||||
def DashClient: String = "-client"
|
||||
def DashDashClient: String = "--client"
|
||||
def CloseIOStreams: String = "--close-io-streams"
|
||||
def DashDashDetachStdio: String = "--detach-stdio"
|
||||
|
||||
def StashOnFailure: String = "sbtStashOnFailure"
|
||||
def PopOnFailure: String = "sbtPopOnFailure"
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ object BasicKeys {
|
|||
"List of template resolver infos.",
|
||||
1000
|
||||
)
|
||||
private[sbt] val closeIOStreams = AttributeKey[Boolean](
|
||||
"close-io-streams",
|
||||
private[sbt] val detachStdio = AttributeKey[Boolean](
|
||||
"detach-stdio",
|
||||
"Toggles wheter or not to close system in, out and error when the server starts.",
|
||||
1000
|
||||
)
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ class NetworkClient(
|
|||
).mkString(",")
|
||||
|
||||
val cmd = List(arguments.sbtScript) ++ arguments.sbtArguments ++
|
||||
List(BasicCommandStrings.CloseIOStreams, BasicCommandStrings.DashDashServer)
|
||||
List(BasicCommandStrings.DashDashDetachStdio, BasicCommandStrings.DashDashServer)
|
||||
val processBuilder =
|
||||
new ProcessBuilder(cmd: _*)
|
||||
.directory(arguments.baseDirectory)
|
||||
|
|
|
|||
|
|
@ -86,14 +86,14 @@ private[sbt] object xMain {
|
|||
NetworkClient.run(dealiasBaseDirectory(configuration), args)
|
||||
Exit(0)
|
||||
} else {
|
||||
val closeStreams = userCommands.exists(_ == BasicCommandStrings.CloseIOStreams)
|
||||
val detachStdio = userCommands.exists(_ == BasicCommandStrings.DashDashDetachStdio)
|
||||
val state0 = StandardMain
|
||||
.initialState(
|
||||
dealiasBaseDirectory(configuration),
|
||||
Seq(defaults, early),
|
||||
runEarly(DefaultsCommand) :: runEarly(InitCommand) :: BootCommand :: Nil
|
||||
)
|
||||
.put(BasicKeys.closeIOStreams, closeStreams)
|
||||
.put(BasicKeys.detachStdio, detachStdio)
|
||||
val state = bootServerSocket match {
|
||||
case Some(l) => state0.put(Keys.bootServerSocket, l)
|
||||
case _ => state0
|
||||
|
|
@ -230,7 +230,9 @@ object StandardMain {
|
|||
|
||||
import BasicCommandStrings.isEarlyCommand
|
||||
val userCommands =
|
||||
configuration.arguments.map(_.trim).filterNot(_ == BasicCommandStrings.CloseIOStreams)
|
||||
configuration.arguments
|
||||
.map(_.trim)
|
||||
.filterNot(_ == BasicCommandStrings.DashDashDetachStdio)
|
||||
val (earlyCommands, normalCommands) = (preCommands ++ userCommands).partition(isEarlyCommand)
|
||||
val commands = (earlyCommands ++ normalCommands).toList map { x =>
|
||||
Exec(x, None)
|
||||
|
|
|
|||
|
|
@ -246,7 +246,11 @@ private[sbt] final class CommandExchange {
|
|||
firstInstance.set(false)
|
||||
}
|
||||
Terminal.setBootStreams(null, null)
|
||||
if (s.get(BasicKeys.closeIOStreams).getOrElse(false)) Terminal.close()
|
||||
|
||||
if (s.get(BasicKeys.detachStdio).getOrElse(false)) {
|
||||
Terminal.close()
|
||||
}
|
||||
|
||||
s.get(Keys.bootServerSocket).foreach(_.close())
|
||||
}
|
||||
s.remove(Keys.bootServerSocket)
|
||||
|
|
|
|||
Loading…
Reference in New Issue