Skip to content

Commit 9edba58

Browse files
Improve bash checking in test_finder.sh for all OSes (#1058) (#1060)
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> (cherry picked from commit 7b1a0e1) Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 4da590c commit 9edba58

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test_finder.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ if [ -z $TEST_TYPE ]; then
2929
[ -f $OSD_BUILD_MANIFEST ] && TEST_TYPE="manifest" || TEST_TYPE="default"
3030
fi
3131

32-
[ ! `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
32+
if [ `echo $OSTYPE | grep -i 'linux'` ] || [ `echo $OSTYPE | grep -i 'darwin'` ]
33+
then
34+
[ ! `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
35+
else
36+
[ ! `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
37+
fi
38+
3339

3440
# Checks if build manifest in parent directory of current directory under local-test-cluster/opensearch-dashboards-*
3541
# When the test script executed in the CI, it scales up OpenSearch Dashboards under local-test-cluster with a

0 commit comments

Comments
 (0)