Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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