Skip to content

Commit

Permalink
Auto create adapter directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Nov 26, 2023
1 parent a212a43 commit f9ac967
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ class AdapterLoaderImpl : AdapterLoader, KoinComponent {
override var adaptersJson: JsonArray = JsonArray()

override fun loadAdapters() {
adapters = plugin.dataFolder["adapters"].listFiles()?.filter { it.extension == "jar" }?.mapNotNull {
val dir = plugin.dataFolder["adapters"]
if (!dir.exists()) {
dir.mkdirs()
}

adapters = dir.listFiles()?.filter { it.extension == "jar" }?.mapNotNull {
logger.info("Loading adapter ${it.nameWithoutExtension}")
try {
loadAdapter(it)
Expand Down

0 comments on commit f9ac967

Please sign in to comment.