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

Associative arrays do not work in properly #785

Closed
everactivetim opened this issue Jun 24, 2022 · 5 comments
Closed

Associative arrays do not work in properly #785

everactivetim opened this issue Jun 24, 2022 · 5 comments
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.

Comments

@everactivetim
Copy link

  • Task version: Task version: v3.13.0 (h1:H1LzM7Ac2Ixz26086sgN7xxueXHcjVwy7qt9BrboiTs=)
  • Operating System: Ubuntu 22.04

I believe this is the result of this issue I filed with sh: mvdan/sh#884

Example Taskfile showing the issue

version: '3'

tasks:
  default:
    cmds:
      - |
        declare -A database_lookup
        database_lookup["management"]=management
        database_lookup["devicetwin"]=devicetwin
        database_lookup["identity"]=identity
        
        for d in "${!database_lookup[@]}"
        do
          echo $d
        done
@everactivetim
Copy link
Author

Output of Taskfile:

0

Output from same as shell script:

identity
devicetwin
management

@ghostsquad
Copy link
Contributor

May want to file this with https://github.com/mvdan/sh

@ghostsquad ghostsquad added the dep: mvdan/sh Issues related to the upstream interpreter used by Task. label Jun 27, 2022
@ghostsquad ghostsquad closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2022
@everactivetim
Copy link
Author

I did. I thought you/users might want a tracking issue here until that is resolved since Taskfiles are broken for this use case until then. If not, ok.

@andreynering
Copy link
Member

Hi @everactivetim,

Thanks for taking the initiative of opening the issue upstream (I usually have to do it myself).

I'll close this since it has been fixed at mvdan/sh#893 and I just upgraded the library here as well.

@everactivetim
Copy link
Author

@andreynering - Thanks to you for responding so quickly to the upstream fix. Happy to do my small part!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.
Projects
None yet
Development

No branches or pull requests

3 participants