Last active
June 12, 2017 14:54
-
-
Save altphi/366861ce7483ca92d20a98f0f9cc6222 to your computer and use it in GitHub Desktop.
post-merge git hook to create OSX alert when any package.json file changed
This file contains hidden or 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
#!/usr/bin/env bash | |
# move this file to .git/hooks/post-merge | |
diff_results=$( git diff-tree --name-status -t -r --root HEAD@{1}..HEAD | grep -e '^M.*package.json$' ) | |
[[ "$?" == "0" ]] && ( | |
msg="display alert \"A package.json file changed! See list below.\" message \"${diff_results}\"" | |
osascript -e "${msg}" >/dev/null & | |
) | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment