Skip to content

Instantly share code, notes, and snippets.

@ngryman
Created October 15, 2019 11:06
Show Gist options
  • Save ngryman/fa085849e6f5dbeefcd9208a784e4216 to your computer and use it in GitHub Desktop.
Save ngryman/fa085849e6f5dbeefcd9208a784e4216 to your computer and use it in GitHub Desktop.
Pre-commit hook to detect dependencies changes in a monorepo
has_package_changed=$(git diff --cached --quiet */package.json packages/*/package.json; echo $?)
if [ $has_package_changed = 1 ]; then
# do stuff
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment