Script, pour GIT, d'interception d'événements "post-merge" et "post-checkout" qui devrait exécuter :
composer.phar install
"composer.lock
a été modifié ;npm install
"package-lock.json
a été modifié, ou, s'il ne s'agit pas d'un "rebase" :
composer.phar update
"composer.json
a été modifié ; npm update
"package.json
a été modifié.#!/bin/sh
case
$(basename $0) in
exit
; while
read line do
echo
$line | awk '{ print $2 }') if
[ "x$FIRST_NEW_COMMIT" = "x" ]; then
fi
done
echo
Run the following commands in
order to install $(readlink $0) : echo
cp $0 .git/hooks echo
cd .git/hooks echo
chmod +x $(basename $(readlink $0)) echo
ln -s $(basename $(readlink $0)) post-checkout echo
ln -s $(basename $(readlink $0)) post-merge echo
ln -s $(basename $(readlink $0)) post-rewrite echo
ln -s $(basename $(readlink $0)) pre-rebase exit
; esac
if
[ -f $REBASE_FLAG ]; then
exit
; fi
grep
'^composer\.\(json\|lock\)$') if
[ -n "$CHANGED_COMPOSER_FILES" ]; then
if
[ "x$COMPOSER_PHAR" = "x" ]; then
for
P in
$HOME/bin $HOME/Library $(echo
$PATH | sed
's/:/ /g') do
if
[ -d $P -a -f $P/composer.phar ]; then
fi
done
fi
if
[ "x$COMPOSER_PHAR" != "x" ]; then
if
[ -x $COMPOSER_PHAR ]; then
else
fi
fi
echo
$CHANGED_COMPOSER_FILES | grep
lock > /dev/null \ fi
grep
'^package\(-lock\)\?\.json$') if
[ -n "$CHANGED_NODEJS_FILES" ]; then
echo
$CHANGED_NODEJS_FILES | grep
lock > /dev/null \ fi