Merge pull request #693 from exapsy/add-xdgopen-on-make-script

Add test to see if command exists with POSIX 'command'
This commit is contained in:
Anmol Sethi 2023-02-10 00:47:45 -08:00 committed by GitHub
commit 45e4d2569d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,13 @@ FORCE_COLOR=1 DEBUG=1 go run ./e2etests/report/main.go "$@";
if [ -z "${NO_OPEN:-}" ]; then
if [ -s "$REPORT_OUTPUT" ]; then
open "$REPORT_OUTPUT"
if command -v open >/dev/null; then
open "$REPORT_OUTPUT"
elif command -v xdg-open >/dev/null; then
xdg-open "$REPORT_OUTPUT"
else
echo "Please open $REPORT_OUTPUT"
fi
else
echo "The report is empty"
fi