Skip to content

Achieve this behaviour with the "skip" option #463

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

You must be logged in to vote

Hey! There is a files option that allows to skip execution if the result of files is empty. I think it can fit your case:

Haven't tested this, so the command may need some edits

# lefthook.yml

post-merge:
  commands:
    run-install:
      files: git diff --name-only HEAD@{1} HEAD | grep -E "(^packages\/.*\/package-lock\.json)|(^package-lock\.json)"
      run: npm install

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@PointSingularity
Comment options

@mrexox
Comment options

@PointSingularity
Comment options

@mrexox
Comment options

@PointSingularity
Comment options

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