Skip to content

Instantly share code, notes, and snippets.

View nishitlangaliya's full-sized avatar

Nishit Langaliya nishitlangaliya

View GitHub Profile
@nishitlangaliya
nishitlangaliya / pre-commit
Created June 5, 2018 12:22 — forked from emgk/pre-commit
Local phpcs pre-commit script
#!/bin/bash
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# parse config
CONFIG_FILE=$(dirname $0)/config
if [ -e $CONFIG_FILE ]; then
. $CONFIG_FILE