Created
January 22, 2024 12:46
-
-
Save gusribeiro/d8818978b360b8796992c5c9e4be2a29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
. "$(dirname "$0")/_/husky.sh" | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
if echo "$changed_files" | grep -q "$1"; then | |
echo "Found diff in $1" | |
eval "$2" | |
else | |
echo "Not found any diff in $1" | |
fi | |
} | |
check_run package.json "yarn || npm install" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment