cwltool icon indicating copy to clipboard operation
cwltool copied to clipboard

Experimental feature to change substitution prefix.

Open tetron opened this issue 6 years ago • 2 comments

Example of combining this feature with attachments (https://github.com/common-workflow-language/schema_salad/pull/254) to simplify wrapping an inline bash script:

#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
$namespaces:
  cwltool: "http://commonwl.org/cwltool#"
baseCommand: [/bin/sh, script]
requirements:
  cwltool:SubstitutionPrefix:
    substitutionPrefix: "@"
  InitialWorkDirRequirement:
    listing:
      - entryname: script
        entry: {$include: "#attachment-1"}
inputs:
  msg: string
outputs:
  output:
    type: File
    outputBinding:
      glob: output.txt
--- |
echo Zip@(inputs.msg) $(date) > output.txt

tetron avatar Jun 10 '19 14:06 tetron

For your example I would demonstrate use of EnvVarRequirement and turn off the substitution altogether

mr-c avatar Jun 11 '19 14:06 mr-c

I like it. I think having this would solve a lot of issues.

However I still believe InitialWorkDirRequirement is not the most logical place for the inclusion of scripts. We still need a construct that is intuitively for including scripts and setting them as the tool's command, which is where my ScriptTool proposal etc come in. That said we could reasonably add this substitutionPrefix feature in independently from any better mechanism for referring to scripts.

multimeric avatar Jun 13 '19 00:06 multimeric