Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
post-merge hook for composer php apps
#/usr/bin/env bash
# MIT © Sindre Sorhus -
# 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"

This comment has been minimized.

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