Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Commit

Permalink
Added installer for phpcs to the drupal pre commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybatch committed Nov 22, 2016
1 parent 25217e3 commit 69ea410
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drupal-pre-commit-hook
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

if [ "$1" == '--install' ]; then
which phpcs
if [ "$?" != 0 ]; then
composer global require squizlabs/php_codesniffer
composer global require drupal/coder
composer global require graphp/graphviz

echo "export PATH=$PATH:$HOME/.composer/vendor/bin/" >> ~/.bashrc
$HOME/.composer/vendor/bin/phpcs --config-set installed_paths $HOME/.composer/vendor/drupal/coder/coder_sniffer
source ~/.bashrc
fi

mkdir -p $HOME/.neontabs
logfile=$HOME/.neontabs/$(basename $0).$(date +"%y-%m-%d_%H-%M").log
filelist="$(locate .git/config)"
Expand Down

0 comments on commit 69ea410

Please sign in to comment.