Skip to content

Commit 91a29b2

Browse files
committed
Search for .bat etc only on Windows
1 parent ac26ad8 commit 91a29b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared/src/main/kotlin/org/javacs/kt/classpath/ShellClassPathResolver.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import java.nio.file.Files
55
import java.nio.file.Path
66
import java.nio.file.Paths
77
import org.javacs.kt.util.userHome
8+
import org.javacs.kt.util.isOSWindows
89
import org.javacs.kt.LOG
910

1011
/** Executes a shell script to determine the classpath */
@@ -31,7 +32,7 @@ internal class ShellClassPathResolver(
3132
companion object {
3233
private val configDirNames = listOf("kotlin-language-server", "KotlinLanguageServer")
3334
private val scriptNames = listOf("kls-classpath", "kotlinLspClasspath")
34-
private val scriptExtensions = listOf("", ".sh", ".bat", ".cmd")
35+
private val scriptExtensions = if (isOSWindows()) listOf(".bat", ".cmd", ".ps1") else listOf("", ".sh", ".bash")
3536

3637
/** Create a shell resolver if a file is a pom. */
3738
fun maybeCreate(file: Path): ShellClassPathResolver? =

0 commit comments

Comments
 (0)