summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-17 19:51:12 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-21 02:33:29 +0200
commit4d032271ce65f6ad816ca71cd8d77fc0b6f6fc1a (patch)
tree3617da03c4f3c89fd2f20a178c8627fcad4afa79
parent7d2c3cc9ebee14ddfa8590431babb1ee06e7693d (diff)
scripts: pre-commit: Support uuidgen as an alternative to uuid
The uuidgen command, from the uuid-runtime package on Debian, can generate UUIDs. If the uuid command isn't available, fallback to uuidgen. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xscripts/pre-commit.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/pre-commit.sh b/scripts/pre-commit.sh
index bc7fb6e..2ea61c9 100755
--- a/scripts/pre-commit.sh
+++ b/scripts/pre-commit.sh
@@ -2,6 +2,14 @@
set -e
+uuid() {
+ if which uuid >/dev/null 2>&1 ; then
+ uuid
+ else
+ uuidgen
+ fi
+}
+
if git rev-parse --verify HEAD >/dev/null 2>&1
then
base=HEAD