Skip to content

Define ENV vars not static #1630

@wburningham

Description

@wburningham

Given the current taskfile:

version: 3

tasks:
  default:
    env:
      EFOO: "little env foo"
      EBAR: "little env bar"
    vars:
      VFOO: "little var foo"
      VBAR: "little var bar"
    cmds:
      - cmd: echo $EFOO
      - cmd: echo $EBAR
      - cmd: echo {{.VFOO}}
      - cmd: echo {{.VBAR}}

With the given invocation:

EBAR="BIG ENV BAR" VBAR="BIG VAR BAR" task

Outputs:

task: [default] echo $EFOO
little env foo
task: [default] echo $EBAR
BIG ENV BAR
task: [default] echo little var foo
little var foo
task: [default] echo little var bar
little var bar

Since the ENV defined in the taskfile are static AND they are not using the {{ default ...}} pattern I would expect that all output says "little...". Am I mistaken? Also shouldn't vars and env behave the same?

Thanks for clarifying this case.

  • Task version: v3.36.0 (h1:XVJ5hQ5hdzTAulHpAGzbUMUuYr9MUOEQFOFazI3hUsY=)
  • Operating system: macOS 14.4.1
  • Experiments enabled: remote taskfiles (but it should not affect this case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions