Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Aug 14, 2024
1 parent 921fa8b commit 653b328
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/scala/io/viash/wrapper/BashWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,21 @@ object BashWrapper {
}

private def generateWorkDir(argsMetaAndDeps: Map[String, List[Argument[_]]]): BashWrapperMods = {
def renderStrs = argsMetaAndDeps.map{case (key, args) =>
def renderYamlStrs = args.map(arg => {
s"""ViashRenderYamlKeyValue '${arg.plainName}' '${arg.`type`}' "${arg.multiple}" "$${${arg.VIASH_PAR}:-UNDEFINED}" >> "$$VIASH_WORK_PARAMS""""
val renderStrs = argsMetaAndDeps.map{case (key, args) =>
val renderYamlStrs = args.map(arg => {
val value =
if (arg.multiple) {
s"$${${arg.VIASH_PAR}[@]}"
} else {
s"$${${arg.VIASH_PAR}:-UNDEFINED}"
}
s"""ViashRenderYamlKeyValue '${arg.plainName}' '${arg.`type`}' "${arg.multiple}" "${value}" >> "$$VIASH_WORK_PARAMS""""
})
s"""echo '${key}:' >> "$$VIASH_WORK_PARAMS"
|${renderYamlStrs.mkString("\n")}""".stripMargin
}

def preRun =
val preRun =
s"""VIASH_WORK_DIR=$$(mktemp -d "$$VIASH_META_TEMP_DIR/viash-run-testbash-XXXXXX")
|function clean_up {
| rm -rf "$$VIASH_WORK_DIR"
Expand Down

0 comments on commit 653b328

Please sign in to comment.