Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having & in Directory name causing problems. #1551

Closed
butuzov opened this issue Mar 14, 2024 · 3 comments · Fixed by #1584
Closed

Having & in Directory name causing problems. #1551

butuzov opened this issue Mar 14, 2024 · 3 comments · Fixed by #1584
Labels
type: bug Something not working as intended.

Comments

@butuzov
Copy link
Contributor

butuzov commented Mar 14, 2024

  • Task version: 3.35.1
  • Operating system: darwin 13.6.5 (m1)
  • Experiments enabled: no idea.

Running task in watch mode with next configuration

# https://taskfile.dev

version: '3'

vars:
  GREETING: Hello, World!

tasks:
  default:
    sources:
    - ./**/*.*
    - ./*.* 
    method: timestamp
    cmds:
      - ./update_me_please
    silent: true

Causes it to fail with proximatly next message

/Path/Teka/Father&Sone/first_path.txt: 1:64: & is not a valid word

So having "&" in folder is a problem...

related - #1069

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Mar 14, 2024
@vergenzt
Copy link
Contributor

vergenzt commented Apr 2, 2024

I've encountered this same issue but with a different special character (parentheses!), and I think I've got a minimal reproduction:

# Taskfile.yml
version: '3'

vars:
  FILE_BASENAME: 'Filename with (parens) & other special chars'

tasks:
  gen:
    generates:
    - '{{.FILE_BASENAME}}.txt'
    cmds:
    - echo foo > '{{.FILE_BASENAME}}.in'

  default:
    deps: [gen]
    sources:
    - '{{.FILE_BASENAME}}.in'
    generates:
    - '{{.FILE_BASENAME}}.txt'
    cmds:
    - cp '{{.FILE_BASENAME}}.in' '{{.FILE_BASENAME}}.txt'

As-is, I get:

$ task
task: [gen] echo foo > 'Filename with (parens) & other special chars.in'
1:51: ( is not a valid word

However with the sources and generates lines from default task removed:

Taskfile.yml (updated)
# Taskfile.yml
version: '3'

vars:
  FILE_BASENAME: 'Filename with (parens) & other special chars'

tasks:
  gen:
    generates:
    - '{{.FILE_BASENAME}}.txt'
    cmds:
    - echo foo > '{{.FILE_BASENAME}}.in'

  default:
    deps: [gen]
    #sources:
    #- '{{.FILE_BASENAME}}.in'
    #generates:
    #- '{{.FILE_BASENAME}}.txt'
    cmds:
    - cp '{{.FILE_BASENAME}}.in' '{{.FILE_BASENAME}}.txt'

the task seems to work fine:

$ task
task: [gen] echo foo > 'Filename with (parens) & other special chars.in'
task: [default] cp 'Filename with (parens) & other special chars.in' 'Filename with (parens) & other special chars.txt'

Interestingly... this error only seems to happen when both sources and generates are provided values with special characters. When I commented out either one of the fields but not the other, the whole thing worked fine!

@andreynering andreynering added type: bug Something not working as intended. and removed state: needs triage Waiting to be triaged by a maintainer. labels Apr 9, 2024
@andreynering andreynering linked a pull request Apr 9, 2024 that will close this issue
@andreynering
Copy link
Member

Hi @butuzov and @vergenzt,

Thanks for the reproduction steps!

I managed to fix this bug on #1584.

@andreynering andreynering changed the title Having & in Directory name causign problems. Having & in Directory name causing problems. Apr 9, 2024
@vergenzt
Copy link
Contributor

Awesome!!! Thanks @andreynering!

When do you think #1584 will be able to be released? I have an active project that uses lots of special characters right now. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something not working as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants