From: Chris Dickens Date: Tue, 26 Dec 2017 23:46:13 +0000 (-0800) Subject: Misc: Fix pre-commit hook to not emit errors in non-Bash shells X-Git-Tag: upstream/1.0.22~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba86d27dca584db96378936a4d54c87c7b0bbfba;p=platform%2Fupstream%2Flibusb.git Misc: Fix pre-commit hook to not emit errors in non-Bash shells Signed-off-by: Chris Dickens --- diff --git a/.private/pre-commit.sh b/.private/pre-commit.sh index c495e33..346d48a 100755 --- a/.private/pre-commit.sh +++ b/.private/pre-commit.sh @@ -26,7 +26,13 @@ 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=`expr $NANO + $BRANCH_OFFSET` diff --git a/libusb/version_nano.h b/libusb/version_nano.h index a6ee2d5..d978e75 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11224 +#define LIBUSB_NANO 11225