File tree Expand file tree Collapse file tree
src/main/kotlin/com/mituuz/fuzzier/grep/backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ intellijPlatform {
4949 <li>
5050 Update minimum version to 2026.1
5151 </li>
52+ <li>
53+ Add fallback for finding rg with wsl2
54+ </li>
5255 </ul>
5356 """ .trimIndent()
5457
Original file line number Diff line number Diff line change 55- Update dependencies
66- Fix ETD errors
77- Update minimum version to 2026.1
8+ - Add fallback for finding rg with wsl2
89
910## Version 2.2.1
1011
Original file line number Diff line number Diff line change 2424
2525package com.mituuz.fuzzier.grep.backend
2626
27+ import com.intellij.execution.process.ProcessNotCreatedException
2728import com.intellij.openapi.components.service
2829import com.mituuz.fuzzier.runner.CommandRunner
2930import com.mituuz.fuzzier.settings.FuzzierGlobalSettingsService
@@ -47,14 +48,17 @@ class BackendResolver(val isWindows: Boolean) {
4748 executable : String ,
4849 projectBasePath : String
4950 ): Boolean {
50- val command = if (isWindows) {
51- listOf (" where" , executable)
51+ val result = if (isWindows) {
52+ try {
53+ commandRunner.runCommandForOutput(listOf (" where" , executable), projectBasePath)
54+ } catch (_: ProcessNotCreatedException ) {
55+ // Fallback for WSL2
56+ commandRunner.runCommandForOutput(listOf (" which" , executable), projectBasePath)
57+ }
5258 } else {
53- listOf (" which" , executable)
59+ commandRunner.runCommandForOutput( listOf (" which" , executable), projectBasePath )
5460 }
5561
56- val result = commandRunner.runCommandForOutput(command, projectBasePath)
57-
5862 return ! (result.isNullOrBlank() || result.contains(" Could not find files" ))
5963 }
6064}
You can’t perform that action at this time.
0 commit comments