Skip to content

Commit cde6b9b

Browse files
carenasgitster
authored andcommitted
ci: make failure to find perforce more user friendly
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 <[email protected]> Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6cd33dc commit cde6b9b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ci/install-dependencies.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,19 @@ linux-gcc-default)
7878
;;
7979
esac
8080

81-
if type p4d >/dev/null && type p4 >/dev/null
81+
if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
8282
then
8383
echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
8484
p4d -V | grep Rev.
8585
echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
8686
p4 -V | grep Rev.
87+
else
88+
echo >&2 "WARNING: perforce wasn't installed, see above for clues why"
8789
fi
88-
if type git-lfs >/dev/null
90+
if type git-lfs >/dev/null 2>&1
8991
then
9092
echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
9193
git-lfs version
94+
else
95+
echo >&2 "WARNING: git-lfs wasn't installed, see above for clues why"
9296
fi

0 commit comments

Comments
 (0)