From 4d032271ce65f6ad816ca71cd8d77fc0b6f6fc1a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 17 Mar 2021 19:51:12 +0200 Subject: 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 --- scripts/pre-commit.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts/pre-commit.sh') 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 -- cgit v1.2.3