Component: start ProfileComponent

This commit is contained in:
zt515
2017-12-10 23:34:46 +08:00
parent 2f62e720c2
commit c712e2b08f

View File

@ -1,7 +1,9 @@
package io.neoterm.component.profile
import io.neoterm.frontend.component.NeoComponent
import io.neoterm.frontend.config.NeoTermPath
import io.neoterm.frontend.session.shell.ShellProfile
import java.io.File
/**
* @author kiva
@ -9,14 +11,21 @@ import io.neoterm.frontend.session.shell.ShellProfile
class ProfileComponent : NeoComponent {
private val profileList = mutableListOf<ShellProfile>()
private fun checkForFiles() {
val profileDir = File(NeoTermPath.PROFILE_PATH)
if (!profileDir.exists()) {
profileDir.mkdirs()
}
}
override fun onServiceInit() {
checkForFiles()
}
override fun onServiceDestroy() {
}
override fun onServiceObtained() {
checkForFiles()
}
}