in multiversion/src/main/scala/multiversion/commands/PantsExportCommand.scala [77:114]
def runPantsExport(): Result[Unit] = {
val binary = workingDirectory.resolve("pants")
if (useCachedExport) {
ValueResult(())
} else if (!Files.isRegularFile(binary)) {
ErrorResult(
Diagnostic.error(
s"no Pants script detected at '$binary'. " +
s"To fix this problem change the working directory to the root of a Pants build."
)
)
} else {
val outputOption =
s"--bazel-multideps-generate-multideps-output-file=$outputPath"
val command = List[String](
binary.toString(),
"bazel-multideps"
) ++ pantsTargets ++ List(outputOption)
val commandString = command.mkString(" ")
val pr = new ProcessRenderer(command, command, clock = app.env.clock)
val p = ProgressBars.create(app, pr)
val proc = ProgressBars.run(p) {
app
.process(command.map(Shellable.StringShellable(_)): _*)
.call(
cwd = workingDirectory,
stdout = pr.output,
stderr = pr.output,
check = false
)
}
if (proc.exitCode != 0) {
pr.asErrorResult(proc.exitCode)
} else {
ValueResult(())
}
}
}