Skip to content

Use sources as variable #948

@NVolcz

Description

@NVolcz

For a task, is the list of files specified in sources available for commands so it can be used as a variable?
I have a script that that I would like to pass the list of sources available to:

version: '3'

tasks:
  test:
    cmds:
      - echo {{.sources}}
      - ./test/shellcheck.sh {{.sources}}
    sources:
      - *.sh

Alternatively if it was possible to use vars for sources:

version: '3'

tasks:
  test:
    cmds:
      - echo {{.sources}}
      - ./test/shellcheck.sh {{.sources}}
    vars:
      SCRIPTS:
        sh: find . -iname '*.sh' -not -path './cygwin/*' | xargs echo
    sources:
      - {{.BASH_SCRIPTS}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are good for first-time contributors to pick up.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions