Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nick-youngblut opened this issue Dec 16, 2024 · 1 comment
Open

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

nick-youngblut opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@nick-youngblut
Copy link
Contributor

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

@bentsherman
Copy link
Member

The process input/output types are documented here with more examples. The reference page is still new and relatively sparse. I haven't decided on what else should be moved into the reference docs vs the main process page which is more of a user guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants