Misc: Fix pre-commit hook to not emit errors in non-Bash shells

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
Chris Dickens 2017-12-26 15:46:13 -08:00
parent 1bd541e45d
commit ba86d27dca
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,13 @@
BRANCH_OFFSET=10000 BRANCH_OFFSET=10000
################################################################################ ################################################################################
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; } if [ "$BASH_VERSION" = '' ]; then
TYPE_CMD="type git >/dev/null 2>&1"
else
TYPE_CMD="type -P git &>/dev/null"
fi
eval $TYPE_CMD || { echo "git command not found. Aborting." >&2; exit 1; }
NANO=`git log --oneline | wc -l` NANO=`git log --oneline | wc -l`
NANO=`expr $NANO + $BRANCH_OFFSET` NANO=`expr $NANO + $BRANCH_OFFSET`

View File

@ -1 +1 @@
#define LIBUSB_NANO 11224 #define LIBUSB_NANO 11225