Skip to content

Global arrays use 'declare -a' inside the initialize function - not accessible in commands #569

@Ksauder

Description

@Ksauder

Bashly Version

Latest Docker Image

Description

Haven't been able to get global arrays working, and I believe the declare within a function is the issue.

Contents of bashly.yml

name: cli
help: Sample application
version: 0.1.0

variables:
  - name: testarr
    value:
      - val1
      - val2
  - name: globvar
    value: global
  - name: globalaarray
    value:
      val1: one
      val2: two

commands:
  - name: printarr
    alias: pa
    variables:
      - name: localarr
        value:
          - localval1
          - localval2

Reproduction Steps

docker container bashly generate
./cli pa

Actual Behavior

No response

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions