Skip to content

Recipe-level environment variables #2825

@iloveitaly

Description

@iloveitaly

Right now, if I want to set an environment variable just for a single recipe, but for all commands executed on that recipe, this is the only way I'm aware of to do this:

test $THE_ENV='hi':
  echo $THE_EN

This works great unless you need to accept additional parameters. Then it breaks.

Here's an example:

test $THE_ENV='hi' *args:
  echo $THE_ENV
  echo {{args}}

And some output:

❯ just test this arg gets assigned
echo $THE_ENV
this
echo arg gets assigned
arg gets assigned

It would be great if it was possible to assign a static recipe-level environment variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions