Skip to content

Commit

Permalink
#1 fix bugs 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dubkov committed Aug 27, 2021
1 parent 67426df commit a66c86e
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ prefs=$(mdfind "extensions" kind:folder | grep "Android" | sed 's/ *\/extensions
count_pref=$(mdfind "extensions" kind:folder | grep "Android" | sed 's/ *\/extensions//' | wc -l | sed 's/^[[:blank:]]*//g')
if [ "$count_pref" -ge 2 ]; then
printf "\nYou have several ($count_pref) Android Studio settings: \n"
mdfind "extensions" kind:folder | grep "Android" | sed 's/ *\/extensions//'
mdfind "extensions" kind:folder | grep "Android" | grep "Google" | sed 's/ *\/extensions//' | sed 's/^/ - /'
printf "[!] To work correctly, leave one!\n\n"
fi

Expand All @@ -103,24 +103,28 @@ fi
jdk_tables=$(mdfind "jdk" | grep "table" | grep "Android")
jdk_count=$(mdfind "jdk" | grep "table" | grep "Android" | wc -l | sed 's/^[[:blank:]]*//g')
studio_jdk_set=0
for (( i = 1; i <= jdk_count; i++))
do
file=$(``mdfind "jdk" | grep "table" | grep "Android" | sed -n "${i}p" )
# echo "$i => $file"
jdk_out=$(grep $JAVA_HOME "$file")
if [ "$jdk_out" ];
if [ "$jdk_tables" ]; then
for (( i = 1; i <= jdk_count; i++))
do
file=$(``mdfind "jdk" | grep "table" | grep "Android" | sed -n "${i}p" )
# echo "$i => $file"
jdk_out=$(grep $JAVA_HOME "$file")
if [ "$jdk_out" ];
then
studio_jdk_set=1
fi
# echo "sjs : $studio_jdk_set"

done
if [ $studio_jdk_set -eq 1 ];
then
studio_jdk_set=1
printf "\t[+] Android Studio JDK is set.\n"
else
printf "\t[-] Android Studio JDK is not set!\n"
installed_correctly=0
fi
# echo "sjs : $studio_jdk_set"

done
if [ $studio_jdk_set -eq 1 ];
then
printf "\t[+] Android Studio JDK is set.\n"
else
printf "\t[-] Android Studio JDK is not set!\n"
installed_correctly=0
else
printf "KEK"
fi

#######
Expand Down

0 comments on commit a66c86e

Please sign in to comment.