Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ intellijPlatform {
<li>
Update minimum version to 2026.1
</li>
<li>
Add fallback for finding rg with wsl2
</li>
</ul>
""".trimIndent()

Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Update dependencies
- Fix ETD errors
- Update minimum version to 2026.1
- Add fallback for finding rg with wsl2

## Version 2.2.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package com.mituuz.fuzzier.grep.backend

import com.intellij.execution.process.ProcessNotCreatedException
import com.intellij.openapi.components.service
import com.mituuz.fuzzier.runner.CommandRunner
import com.mituuz.fuzzier.settings.FuzzierGlobalSettingsService
Expand All @@ -47,14 +48,17 @@ class BackendResolver(val isWindows: Boolean) {
executable: String,
projectBasePath: String
): Boolean {
val command = if (isWindows) {
listOf("where", executable)
val result = if (isWindows) {
try {
commandRunner.runCommandForOutput(listOf("where", executable), projectBasePath)
} catch (_: ProcessNotCreatedException) {
// Fallback for WSL2
commandRunner.runCommandForOutput(listOf("which", executable), projectBasePath)
}
} else {
listOf("which", executable)
commandRunner.runCommandForOutput(listOf("which", executable), projectBasePath)
}

val result = commandRunner.runCommandForOutput(command, projectBasePath)

return !(result.isNullOrBlank() || result.contains("Could not find files"))
}
}
Loading