change-sysadmin-scala_3.0.0.6.source-code.stepRunBody-untemplate.scala Maven / Gradle / Ivy
// DO NOT HAND EDIT -- Autogenerated from 'stepRunBody.untemplate' at 2023-09-06T16:17:18.636278Z
package com.mchange.sysadmin
import java.io.{Writer,StringWriter}
import scala.collection.*
val Untemplate_stepRunBody = new untemplate.Untemplate[TaskRunner.AbstractStep.Run,Nothing]:
val UntemplateFunction : untemplate.Untemplate[TaskRunner.AbstractStep.Run,Nothing] = this
val UntemplateName : String = "stepRunBody"
val UntemplatePackage : String = "com.mchange.sysadmin"
val UntemplateInputName : String = "run"
val UntemplateInputTypeDeclared : String = "TaskRunner.AbstractStep.Run"
val UntemplateInputTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[TaskRunner.AbstractStep.Run] )
val UntemplateInputDefaultArgument : Option[TaskRunner.AbstractStep.Run] = (None : Option[TaskRunner.AbstractStep.Run])
val UntemplateOutputMetadataTypeDeclared : String = "Nothing"
val UntemplateOutputMetadataTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[Nothing] )
val UntemplateHeaderNote : String = ""
val UntemplateAttributes : immutable.Map[String,Any] = immutable.Map.empty
def apply(run : TaskRunner.AbstractStep.Run) : untemplate.Result[Nothing] =
val writer : StringWriter = new StringWriter(5880)
val attrs : immutable.Map[String,Any] = UntemplateAttributes
var mbMetadata : Option[Nothing] = None
var outputTransformer : Function1[untemplate.Result[Nothing],untemplate.Result[Nothing]] = identity
val block0 = new Function0[String]:
def apply() : String =
"\n"
writer.write(block0())
run match {
case completed : TaskRunner.AbstractStep.Run.Completed =>
val block1 = new Function0[String]:
def apply() : String =
"" + ( mbExitCode( completed ) ) +
"\n" + ( labeledTextOrNA("out", completed.result.stepOut).trim ) +
"\n" + ( labeledTextOrNA("err", completed.result.stepErr).trim ) +
"\n" + ( mbLabeledText( completed.result.notes.map( n => ("notes", n) ) ) ) +
"\n" + ( mbLabeledText( completed.result.carryForwardDescription.map( cfd => ("carryforward", cfd) ) ) ) +
"\n"
writer.write(block1())
case skipped : TaskRunner.AbstractStep.Run.Skipped =>
val block2 = new Function0[String]:
def apply() : String =
"SKIPPED\n"
writer.write(block2())
}
outputTransformer( untemplate.Result( mbMetadata, writer.toString ) )
end apply
end Untemplate_stepRunBody
def stepRunBody(run : TaskRunner.AbstractStep.Run) : untemplate.Result[Nothing] = Untemplate_stepRunBody( run )
© 2015 - 2025 Weber Informatics LLC | Privacy Policy