Skip to content

docs: examples of using env(name) input #5616

Open
@nick-youngblut

Description

@nick-youngblut

New feature

process-reference-inputs states the following for env( name ):

Declare an environment variable input. The received value should be a string, and it will be exported to the task environment as an environment variable given by name.

So, at least to me, that means the following is how it would be implemented:

workflow{
    MY_PROC("test_value")
}

process MY_PROC {
    input:
    env MY_ENV_VAR

    output:
    path "test"

    script:
    """
    echo $MY_ENV_VAR && touch test
    """
}

...but that just results in:

ERROR ~ Error executing process > 'MY_PROC'

Caused by:
  No such variable: MY_ENV_VAR -- Check script 'main.nf' at line: 23


Source block:
  """
  echo $MY_ENV_VAR && touch test
  """

It would be helpful to have >=1 example or at least more clarification in the docs on how to use env

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions