Skip to content

Getting matching files list in script #578

Answered by mrexox
avudnez asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I think I know what may fit your case. You need to use commands instead of scripts and pass the file list to the script manually, like this:

# lefthook.yml

pre-commit:
  commands:
    check-nocommit:
      glob: "*.{adoc,c,cpp,cs,md,py,sh}"
      run: scripts/check-nocommit "{staged_files}"

And in the script you need to iterate the args.

Does it sound helpful?

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@avudnez
Comment options

@mrexox
Comment options

Answer selected by mrexox
@avudnez
Comment options

@mj3c
Comment options

@mrexox
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants