From 40238aeee2b7e67daf4a701791eae5149ffec080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 5 Dec 2024 12:39:04 +0100 Subject: [PATCH] meson: avoid error message if git is not installed [1/9] Generating version.h with a custom command /home/zbyszek/src/systemd/tools/vcs-tag.sh: line 17: git: command not found If git is not available, do not try to call it. --- tools/vcs-tag.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/vcs-tag.sh b/tools/vcs-tag.sh index 5da39cc5396..0150d0b50e1 100755 --- a/tools/vcs-tag.sh +++ b/tools/vcs-tag.sh @@ -4,7 +4,10 @@ set -e MODE="$1" -if ! [[ -d .git ]] || git describe --tags --exact-match &>/dev/null; then +if ! [[ -d .git ]] || + ! command -v git >/dev/null || + git describe --tags --exact-match &>/dev/null +then exit 0 fi