go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.28k stars 599 forks source link

Variable in "dir" breaks shell expanded variables #426

Closed ahawkins closed 3 years ago

ahawkins commented 3 years ago

Example Taskfile showing the issue

I think this is related to #384

version: "3"

vars:
  PROJECT_ROOT:
    sh: echo "Dummy"

tasks:
  init:
    dir: test/{{ .PROJECT }}
    cmds:
      - echo '{{ .PROJECT_ROOT }}'

Break it:

$ mkdir -p test/foo
$ task init PROJECT=foo
task: Command "echo "Dummy"" in taskvars file failed: could not stat: stat /Users/ahawkins/src/skillshare/scratch/test/{{ .PROJECT }}: no such file or directory

I expect that {{ .PROJECT }} should be interpolated.

ahawkins commented 3 years ago

Adding @rvangundy

andreynering commented 3 years ago

Hi @ahawkins, thanks for reporting!

This was indeed a regression, and I just released a fix in v3.2.1.

ahawkins commented 3 years ago

Awesome. Thank you for all your work on Task <3.

// Adam

On Sat, Jan 9, 2021, at 07:02, Andrey Nering wrote:

Hi @ahawkins https://github.com/ahawkins, thanks for reporting!

This was indeed a regression, and I just released a fix in v3.2.1 https://github.com/go-task/task/releases/tag/v3.2.1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/go-task/task/issues/426#issuecomment-757335669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAL6IHPBRP5FWJCSD57LTLSZCD27ANCNFSM4V3ENO4A.