2014-07-28から1日間の記事一覧

gitのpre-commitのでphpの構文チェックとmasterへのコミット禁止

対象のリポジトリで実行 $ touch .git/hooks/pre-commit $ chmod 755 .git/hooks/pre-commit 事前準備はこれでOK #!/bin/sh ROOT_DIR="$(pwd)/" LIST=$(git status | grep -e '\(modified:\|new file:\)'| grep '\.php' | cut -d':' -f2 ) # syntaxエラーが…