From 52bbfe926be03f66d57d15743e9914bc4e201c8c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Oct 2019 15:12:11 +0200 Subject: add uncrustify pre-commit hook --- bootstrap | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bootstrap') diff --git a/bootstrap b/bootstrap index 1ad18f7bf..0d35d01ce 100755 --- a/bootstrap +++ b/bootstrap @@ -1,3 +1,22 @@ #!/bin/sh git submodule update --init + +# This is more portable than `which' but comes with +# the caveat of not(?) properly working on busybox's ash: +existence() +{ + command -v "$1" >/dev/null 2>&1 +} + + +if existence uncrustify; then + echo "Installing uncrustify hook and configuration" + # Install uncrustify format symlink (if possible) + ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null + # Install pre-commit hook (if possible) + ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null +else + echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development" +fi + autoreconf -fi -- cgit v1.2.3