Skip to content

Commit

Permalink
only input multiples are arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Aug 14, 2024
1 parent 653b328 commit 18f594b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/io/viash/wrapper/BashWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -928,13 +928,14 @@ object BashWrapper {
private def generateWorkDir(argsMetaAndDeps: Map[String, List[Argument[_]]]): BashWrapperMods = {
val renderStrs = argsMetaAndDeps.map{case (key, args) =>
val renderYamlStrs = args.map(arg => {
val multiple = arg.multiple && arg.direction == Input
val value =
if (arg.multiple) {
if (multiple) {
s"$${${arg.VIASH_PAR}[@]}"
} else {
s"$${${arg.VIASH_PAR}:-UNDEFINED}"
}
s"""ViashRenderYamlKeyValue '${arg.plainName}' '${arg.`type`}' "${arg.multiple}" "${value}" >> "$$VIASH_WORK_PARAMS""""
s"""ViashRenderYamlKeyValue '${arg.plainName}' '${arg.`type`}' "${multiple}" "${value}" >> "$$VIASH_WORK_PARAMS""""
})
s"""echo '${key}:' >> "$$VIASH_WORK_PARAMS"
|${renderYamlStrs.mkString("\n")}""".stripMargin
Expand Down

0 comments on commit 18f594b

Please sign in to comment.