From 7b1a0e11bb61efa4464e915d16df77dce6524f69 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 5 Feb 2024 18:26:26 -0500 Subject: [PATCH] Improve bash checking in test_finder.sh for all OSes (#1058) Signed-off-by: Peter Zhu --- test_finder.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test_finder.sh b/test_finder.sh index 35b9c5238..535b42624 100755 --- a/test_finder.sh +++ b/test_finder.sh @@ -29,7 +29,13 @@ if [ -z $TEST_TYPE ]; then [ -f $OSD_BUILD_MANIFEST ] && TEST_TYPE="manifest" || TEST_TYPE="default" fi -[ ! `echo $SHELL | grep 'bash'` ] && echo "You must run this script with bash as other shells like zsh will fail the script, exit in 10" && sleep 10 && exit 1 +if [ `echo $OSTYPE | grep -i 'linux'` ] || [ `echo $OSTYPE | grep -i 'darwin'` ] +then + [ ! `echo $SHELL | grep -i 'bash'` ] && echo "You must run this script with bash as other shells like zsh will fail the script, exit in 10!" && sleep 10 && exit 1 +else + [ ! `readlink /proc/$$/exe | grep -i 'bash'` ] && echo "You must run this script with bash as other shells like zsh will fail the script, exit in 10!!" && sleep 10 && exit 1 +fi + # Checks if build manifest in parent directory of current directory under local-test-cluster/opensearch-dashboards-* # When the test script executed in the CI, it scales up OpenSearch Dashboards under local-test-cluster with a