工具在受限制的环境中运行,并且不从父进程继承大多数环境变量。您可以使用EnvVarRequirement为工具设置环境变量。
env.cwl
#!/usr/bin/env cwl-runnercwlVersion: v1.0class: CommandLineToolbaseCommand: envrequirements:EnvVarRequirement:envDef:HELLO: $(inputs.message)inputs:message: stringoutputs:example_out:type: stdoutstdout: output.txt
echo-job.yml
message: Hello world!
运行cwl-runner
$ cwl-runner env.cwl echo-job.yml[job env.cwl] /home/example$ env > /home/example/output.txt[job env.cwl] completed success{"example_out": {"location": "file:///home/example/output.txt","basename": "output.txt","class": "File","checksum": "sha1$1ca16a840b14807b2fd3323022c476b06a150e2f","size": 94,"path": "/home/example/output.txt"}}Final process status is success$ cat output.txtHELLO=Hello world!PATH=/bin:/usr/bin:/usr/local/binHOME=/home/exampleTMPDIR=/tmp/tmp63Obpk
