Skip to content

Commit

Permalink
🌟 add JDK check (fix #70)
Browse files Browse the repository at this point in the history
  • Loading branch information
theapache64 committed Oct 22, 2021
1 parent 334f525 commit fc42733
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class SplashViewModel @Inject constructor(
syncAndCacheLibraries { // first cache libs
syncAndStoreConfig { // then sync config
checkAndFixAdb { // then check adb
_isSyncFinished.value = true // all done
checkJdk {
_isSyncFinished.value = true // all done
}
}
}
}
Expand All @@ -59,6 +61,15 @@ class SplashViewModel @Inject constructor(
}
}

private fun checkJdk(onExist: () -> Unit) {
val isJdkExists = System.getenv("JAVA_HOME") != null
if (isJdkExists) {
onExist()
} else {
_syncFailedMsg.value = "Ohh no! It looks like you don't have JDK installed πŸ˜₯"
}
}


private suspend fun syncAndCacheLibraries(
onSuccess: suspend () -> Unit
Expand Down

0 comments on commit fc42733

Please sign in to comment.