3 # Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
5 # SPDX-License-Identifier: GPL-2.0-only
8 # Install the checkpatch pre-commit hook.
10 DIR
="$( cd "$
( dirname "$0" )" && pwd )"
12 PRECOMMIT_HOOK
="../.git/hooks/pre-commit"
13 PRECOMMIT_SCRIPT
="checkpatch-hook"
14 CHECKPATCH_CONF
=".checkpatch.conf"
16 if [ -f $PRECOMMIT_HOOK ];
18 echo "File $PRECOMMIT_HOOK already exists. Aborting."
21 ln -s $DIR/$PRECOMMIT_SCRIPT $PRECOMMIT_HOOK
24 if [ -f ..
/$CHECKPATCH_CONF ];
26 echo "File ../$CHECKPATCH_CONF already exists. Aborting."
29 ln -s $DIR/$CHECKPATCH_CONF ..
/$CHECKPATCH_CONF
32 echo "Checkpatch pre-commit hook successfully installed!"
This page took 0.033341 seconds and 5 git commands to generate.