Skip to content

Print global vars (without an explicit task to do so) #711

@ghostsquad

Description

@ghostsquad

Sometimes it's very nice to be able to store variables in 1 location (such as in a taskfile), and be able to re-use them programmatically else where. Currently, if I wanted to manage a variable in task, and use it in another script or github action or something, I'd write this:

vars:
   FOO: bar

tasks:
   vars:get:foo:
      cmds:
      - echo '{{.FOO}}'

and call with task vars:get:foo

I feel this could be simplified with something like

task -var foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions