Skip to content

Possibility to allow pass go template variable {{.XYZ}} as string #2625

@pmysiak

Description

@pmysiak

Description

There is no possibility to pass go template variables as string to command

Example:
I would like to run command
docker compose ps -a --format "table {{.ID}}\t{{.Image}}\t{{.Name}}"
but it's impossible due to go task engine evaluate {{.ID}}, {{.Image}}.

Task

docker:compose:services:
    cmds:
      - docker compose ps -a --format "table {{.ID}}"

I tried

  • escaping $$ and {{ "{{" }}
  • printing {{print "{{"}}
  • replacing {{"x" | replace "{" 2}}
  • run as sh -c
  • quoting

I really love taskfile ❤️ It helps me everyday

Thanks

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