From 135a040c00e24035ac8bc9e89dd88a2e611b99b5 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:27:23 -0500 Subject: [PATCH] Improve bash checking in test_finder.sh for all OSes (#1058) (#1059) Signed-off-by: Peter Zhu (cherry picked from commit 7b1a0e11bb61efa4464e915d16df77dce6524f69) Co-authored-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 12a438897..9ea7d0601 100755 --- a/test_finder.sh +++ b/test_finder.sh @@ -23,7 +23,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