From de5c00ac23a9126c2731dc70e845a728c8ebd5ea Mon Sep 17 00:00:00 2001 From: Apostolis Anastasiou Date: Fri, 20 Jan 2023 03:09:16 +0200 Subject: [PATCH] Add test to see if command exists with POSIX 'command' --- ci/e2ereport.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/e2ereport.sh b/ci/e2ereport.sh index ebf45b912..a787aa354 100755 --- a/ci/e2ereport.sh +++ b/ci/e2ereport.sh @@ -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 [ -x "$(command -v open)" ]; then + open $REPORT_OUTPUT + elif [ -x "$(command -v xdg-open)" ]; then + xdg-open $REPORT_OUTPUT + else + echo "Please open $REPORT_OUTPUT" + fi else echo "The report is empty" fi