@@ -201,7 +201,8 @@ object BashWrapper {
201201 val reqMods = generateComputationalRequirements(config)
202202 val parMods = generateParsers(args)
203203 val execMods = config.mainScript match {
204- case Some (_ : Executable ) => generateExecutableArgs(args)
204+ // For executables, only pass the 'par' arguments, not 'meta' or 'dep'
205+ case Some (_ : Executable ) => generateExecutableArgs(argsMetaAndDeps.getOrElse(" par" , List .empty))
205206 case _ => BashWrapperMods ()
206207 }
207208 val depMods = generateDependencies(config)
@@ -916,14 +917,18 @@ object BashWrapper {
916917 // if mainResource is an executable
917918 case Some (e : Executable ) =>
918919 // Execute the executable
920+ // For native engine, run directly. For docker, use -c to pass to shell
919921 val runCode = s """
920- |# Add context
921- |VIASH_RUN_CMD+=" -c ' ${cdToResources}${e.path.get} $$ VIASH_EXECUTABLE_ARGS'"
922- |
923- |# Run command
924- |ViashDebug "Running command: $$ (echo $$ VIASH_RUN_CMD)"
925- |eval $$ VIASH_RUN_CMD &
926- |wait " $$ !"
922+ |# Run executable
923+ |if [[ " $$ VIASH_ENGINE_TYPE" == "docker" ]]; then
924+ | VIASH_RUN_CMD+=" -c ' ${cdToResources}${e.path.get} $$ VIASH_EXECUTABLE_ARGS'"
925+ | ViashDebug "Running command: $$ (echo $$ VIASH_RUN_CMD)"
926+ | eval $$ VIASH_RUN_CMD &
927+ | wait " $$ !"
928+ |else
929+ | ViashDebug "Running command: ${cdToResources}${e.path.get} $$ VIASH_EXECUTABLE_ARGS"
930+ | eval " ${cdToResources}${e.path.get} $$ VIASH_EXECUTABLE_ARGS"
931+ |fi
927932 | """ .stripMargin
928933
929934 BashWrapperMods (
0 commit comments