Page MenuHomePhabricator
Paste P107

Post-merge hook to update composer libraries
ActivePublic

Authored by bd808 on Nov 24 2014, 8:52 PM.
#!/usr/bin/env bash
# Run composer if composer.json has changed
git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD |
grep --quiet composer.json &&
composer update --no-progress --optimize-autoloader

Event Timeline

bd808 edited the content of this paste. (Show Details)Nov 24 2014, 8:52 PM
bd808 changed the title of this paste from untitled to Post-merge hook to update composer libraries.
bd808 updated the paste's language from autodetect to bash.
bd808 added a project: Librarization.

Install as .git/hooks/post-merge in your mediawiki/core.git clone to have composer run automatically when composer.json changes do to a git pull.