diff --git a/scripts/auto-formatter.sh b/scripts/auto-formatter.sh index d9b970e..1cbdb9a 100755 --- a/scripts/auto-formatter.sh +++ b/scripts/auto-formatter.sh @@ -1,6 +1,18 @@ #!/bin/bash -if [[ ! -f README.md ]]; then - cd .. +counter=0 +common_example_dir="example_common" +while [ ${counter} -lt 5 ] +do + if [ ! -d ${common_example_dir} ];then + break + fi + counter=$((counter=counter + 1)) + cd .. +done + +if [ "${counter}" -ge 5 ];then + echo "${common_example_dir} not found in upper directories!" + exit 1 fi folder_list=(