Skip to content

Commit

Permalink
fix large project search
Browse files Browse the repository at this point in the history
  • Loading branch information
Vacxe committed Aug 7, 2023
1 parent 1f44e5b commit 242ba0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "io.github.vacxe"
version = "1.0.1"
version = "1.0.2"

repositories {
mavenCentral()
Expand All @@ -32,6 +32,9 @@ tasks {
patchPluginXml {
sinceBuild.set("222")
untilBuild.set("")
changeNotes.set("""
Configurations search optimisation for large projects. `*.cliactions.yaml` will be searched 1 level depth from root.
""")
}

signPlugin {
Expand All @@ -47,4 +50,5 @@ tasks {

dependencies {
implementation("com.charleskorn.kaml:kaml:0.54.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ package io.github.vacxe.cliactions.configurations
import com.intellij.openapi.project.Project
import org.apache.commons.io.FileUtils
import java.io.File
import java.lang.Thread.sleep
import kotlin.concurrent.thread

class CliActionsConfigurationProvider(private val project: Project) : ConfigurationProvider{
class CliActionsConfigurationProvider(private val project: Project) : ConfigurationProvider {
override fun find(result: (Sequence<File>) -> Unit) {
thread(start = true) {
sleep(10000)
val projectConfigs = File(project.basePath ?: throw Exception("Project basePath cannot be found"))
.walk()
.maxDepth(2)
.filter { it.name.endsWith(ConfigurationFileExtension) }

FileUtils.getUserDirectory()

val userConfigs = FileUtils.getUserDirectory()
.walk()
.maxDepth(1)
Expand Down

0 comments on commit 242ba0d

Please sign in to comment.