3 # Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License, version 2 only, as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, write to the Free Software Foundation, Inc., 51
16 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 # Install the checkpatch pre-commit hook.
20 DIR
="$( cd "$
( dirname "$0" )" && pwd )"
22 PRECOMMIT_HOOK
="../.git/hooks/pre-commit"
23 PRECOMMIT_SCRIPT
="checkpatch-hook"
24 CHECKPATCH_CONF
=".checkpatch.conf"
26 if [ -f $PRECOMMIT_HOOK ];
28 echo "File $PRECOMMIT_HOOK already exists. Aborting."
31 ln -s $DIR/$PRECOMMIT_SCRIPT $PRECOMMIT_HOOK
34 if [ -f ..
/$CHECKPATCH_CONF ];
36 echo "File ../$CHECKPATCH_CONF already exists. Aborting."
39 ln -s $DIR/$CHECKPATCH_CONF ..
/$CHECKPATCH_CONF
42 echo "Checkpatch pre-commit hook successfully installed!"
This page took 0.032292 seconds and 4 git commands to generate.