Skip to content

dir does not create a directory in some cases #1001

@AlekSi

Description

@AlekSi
  • Task version: v3.20.0
  • Operating System: macOS 13.2

Taskfile.yml:

  test-dir:
    dir: does-not-exist
    cmds:
      - echo {{.TEST}}
    vars:
      TEST:
        sh: cat ../exist.txt

dir is documented to create a directory if it does not exist, but that not happens there. If directory "does-not-exist" does not exist, that task fails with:

task: Command "cat ../exist.txt" failed: chdir /<...>/does-not-exist: no such file or directory

So it tries to change directory to "does-not-exist" without creating it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: variablesChanges related to variables.good first issueIssues that are good for first-time contributors to pick up.
    No fields configured for feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions