Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created November 13, 2014 17:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ivoba/6dcdff1d8eaed7e53ec6 to your computer and use it in GitHub Desktop.
Save ivoba/6dcdff1d8eaed7e53ec6 to your computer and use it in GitHub Desktop.
post-merge hook for composer php apps
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
# phponly by Ivo Bathke ;)
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
# `composer install` if the `composer.lock` file gets changed
# to update all the php dependencies
check_run composer.lock "composer install --no-dev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment