Skip to content

Instantly share code, notes, and snippets.

@alherd-by
Created November 2, 2015 12:48
Show Gist options
  • Save alherd-by/d5e50bdb4713dd23178a to your computer and use it in GitHub Desktop.
Save alherd-by/d5e50bdb4713dd23178a to your computer and use it in GitHub Desktop.
#!/bin/bash
changed_files="$(git log --name-status HEAD^..HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "composer.lock" && composer --working-dir=$GIT_WORK_TREE install
}
# `composer install` if the `composer.lock` file gets changed
# to update all the php dependencies
check_run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment