Skip to content

"reached EOF without closing quote" when folder name has a quote in it #2874

@alexeymuranov

Description

@alexeymuranov

Description

I ran task, I expected it to work, but it threw the error:

task: Failed to run task "default": 1:56: reached EOF without closing quote `'`

Here is how I can to reproduce it on Linux Mint Debian Edition.

  1. Create a folder with a quote ' in the name, for example test'd. (It looks like it is enough to have a quote anywhere in the absolute path.)
  2. Put into the folder the following Taskfile.yml:
# yaml-language-server: $schema=https://taskfile.dev/schema.json

version: '3'

tasks:
  default:
    generates:
      - test.out
    sources:
      - test.in
    cmds:
      - cp test.in test.out
$ tree test\'d
test'd
└── Taskfile.yml
  1. Run task from inside the folder.

I've found this example after a lot of debugging. The initial issue was much more subtle: a target was rebuilt every time regardless of sources. There were no quote in the folder name, but there was one somewhere in the absolute path.

Version

3.51.1

Operating system

LMDE 7

Experiments Enabled

No response

Example Taskfile

# yaml-language-server: $schema=https://taskfile.dev/schema.json

version: '3'

tasks:
  default:
    generates:
      - test.out
    sources:
      - test.in
    cmds:
      - cp test.in test.out

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    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