]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: make failure to find perforce more user friendly
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Thu, 12 May 2022 22:39:37 +0000 (15:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 May 2022 22:43:07 +0000 (15:43 -0700)
In preparation for a future change that will make perforce installation
optional in macOS, make sure that the check for it is done without
triggering scary looking errors and add a user friendly message instead.

All other existing uses of 'type <cmd>' in our shell scripts that
check the availability of a command <cmd> send both standard output
and error stream to /dev/null to squelch "<cmd> not found" diagnostic
output, but this script left the standard error stream shown.

Redirect it just like everybody else to squelch this error message that
we fully expect to see.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/install-dependencies.sh

index dbcebad2fb293303f9271850094a29c3a249bda6..fa620f8fcd8404d47dbccac09a42158a698c91f5 100755 (executable)
@@ -78,15 +78,19 @@ linux-gcc-default)
        ;;
 esac
 
-if type p4d >/dev/null && type p4 >/dev/null
+if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
 then
        echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
        p4d -V | grep Rev.
        echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
        p4 -V | grep Rev.
+else
+       echo >&2 "WARNING: perforce wasn't installed, see above for clues why"
 fi
-if type git-lfs >/dev/null
+if type git-lfs >/dev/null 2>&1
 then
        echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
        git-lfs version
+else
+       echo >&2 "WARNING: git-lfs wasn't installed, see above for clues why"
 fi