Skip to content

Instantly share code, notes, and snippets.

@ttaylorr
Created May 1, 2014 03:04
Show Gist options
  • Save ttaylorr/d36a7c0919a84b71ad97 to your computer and use it in GitHub Desktop.
Save ttaylorr/d36a7c0919a84b71ad97 to your computer and use it in GitHub Desktop.
Run `npm install` on post commit if changes are present in package.json
#!/bin/sh
changed=`git diff-tree --no-commit-id --name-only -r HEAD`
if [`grep 'package.json' <<< "$changed"` ] ; then
`npm install`
fi
@ttaylorr
Copy link
Author

ttaylorr commented May 1, 2014

cc @mdo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment