Skip to content

Adding support for environment variable in inputs and outputs field #5475

@RaphaelRibes

Description

@RaphaelRibes

I want to be adding support for environment variable in inputs and outputs field

Problem description

For example being able to do

[tasks.mkdir_test]
cmd = "mkdir -p $INIT_CWD/test"
outputs = ["$INIT_CWD/test"]

or

[tasks.mkdir_test]
args = [
    { arg = "root", default = "$INIT_CWD"}
]
cmd = "mkdir -p {{ root }}/test"
outputs = ["{{ root }}/test"]

For now it returns

pixi run mkdir_test 
✨ Pixi task (mkdir_test in default): mkdir -p $INIT_CWD/test
WARN No files matched the output globs for task 'mkdir_test'
WARN Output globs: `$INIT_CWD/test

Where it should return for example

pixi run mkdir_test 
✨ Pixi task (mkdir_test in default): mkdir -p $INIT_CWD/test

pixi run mkdir_test 
✨ Pixi task (mkdir_test in default): mkdir -p $INIT_CWD/test
Task '_mkdir_outputs' can be skipped (cache hit) 🚀 

ls
test/

With no warning

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