Skip to content

Commit 854b21a

Browse files
committed
Merge branch 'consolidate-jvm-subprocess-and-inprocess-functions' of github.com:sake92/mill into consolidate-jvm-subprocess-and-inprocess-functions
2 parents 3e22493 + 62b5632 commit 854b21a

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

scalalib/src/mill/scalalib/RunModule.scala

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -322,31 +322,31 @@ object RunModule {
322322
val env = Option(forkEnv).getOrElse(forkEnv0)
323323
if (background) {
324324
val (stdout, stderr) = if (runBackgroundLogToConsole) {
325-
// Hack to forward the background subprocess output to the Mill server process
326-
// stdout/stderr files, so the output will get properly slurped up by the Mill server
327-
// and shown to any connected Mill client even if the current command has completed
328-
val pwd0 = os.Path(java.nio.file.Paths.get(".").toAbsolutePath)
329-
(
330-
os.PathAppendRedirect(pwd0 / ".." / ServerFiles.stdout),
331-
os.PathAppendRedirect(pwd0 / ".." / ServerFiles.stderr)
332-
)
333-
} else {
334-
(dest / "stdout.log": os.ProcessOutput, dest / "stderr.log": os.ProcessOutput)
335-
}
336-
Jvm.spawn(
337-
mainClass = mainClass1,
338-
classPath = classPath,
339-
jvmArgs = jvmArgs,
340-
env = env,
341-
mainArgs = mainArgs,
342-
cwd = cwd,
343-
stdin = ProcessInput.makeSourceInput(""): os.ProcessInput,
344-
stdout = stdout,
345-
stderr = stderr,
346-
useCpPassingJar = useClasspathPassingJar,
347-
javaHome = javaHome,
348-
destroyOnExit = false
325+
// Hack to forward the background subprocess output to the Mill server process
326+
// stdout/stderr files, so the output will get properly slurped up by the Mill server
327+
// and shown to any connected Mill client even if the current command has completed
328+
val pwd0 = os.Path(java.nio.file.Paths.get(".").toAbsolutePath)
329+
(
330+
os.PathAppendRedirect(pwd0 / ".." / ServerFiles.stdout),
331+
os.PathAppendRedirect(pwd0 / ".." / ServerFiles.stderr)
349332
)
333+
} else {
334+
(dest / "stdout.log": os.ProcessOutput, dest / "stderr.log": os.ProcessOutput)
335+
}
336+
Jvm.spawn(
337+
mainClass = mainClass1,
338+
classPath = classPath,
339+
jvmArgs = jvmArgs,
340+
env = env,
341+
mainArgs = mainArgs,
342+
cwd = cwd,
343+
stdin = ProcessInput.makeSourceInput(""): os.ProcessInput,
344+
stdout = stdout,
345+
stderr = stderr,
346+
useCpPassingJar = useClasspathPassingJar,
347+
javaHome = javaHome,
348+
destroyOnExit = false
349+
)
350350
} else {
351351
val processResult = Jvm.call(
352352
mainClass = mainClass1,

0 commit comments

Comments
 (0)