mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
IJPL-190497 Eel: introduce EelOsFamily
GitOrigin-RevId: 85dc13d238d63f620c799a6e52f6cf50e87fd2b6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0a21fc47db
commit
0c5c2a29db
@@ -1,6 +1,7 @@
|
||||
package com.jetbrains.python
|
||||
|
||||
import com.intellij.platform.eel.EelPlatform
|
||||
import com.intellij.platform.eel.EelOsFamily
|
||||
import com.intellij.platform.eel.isWindows
|
||||
import com.intellij.platform.eel.provider.getEelDescriptor
|
||||
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread
|
||||
import com.jetbrains.python.venvReader.VirtualEnvReader
|
||||
@@ -11,12 +12,12 @@ import kotlin.io.path.name
|
||||
@RequiresBackgroundThread
|
||||
@ApiStatus.Internal
|
||||
fun PythonBinary.resolvePythonHome(): PythonHomePath = when (getEelDescriptor().platform) {
|
||||
is EelPlatform.Windows -> parent.takeIf { it.name.lowercase() != "scripts" } ?: parent.parent
|
||||
is EelPlatform.Posix -> parent.takeIf { it.name != "bin" } ?: parent.parent
|
||||
EelOsFamily.Windows -> parent.takeIf { it.name.lowercase() != "scripts" } ?: parent.parent
|
||||
EelOsFamily.Posix -> parent.takeIf { it.name != "bin" } ?: parent.parent
|
||||
}
|
||||
|
||||
@RequiresBackgroundThread
|
||||
@ApiStatus.Internal
|
||||
fun PythonHomePath.resolvePythonBinary(): PythonBinary? {
|
||||
return VirtualEnvReader(isWindows = getEelDescriptor().platform is EelPlatform.Windows).findPythonInPythonRoot(this)
|
||||
return VirtualEnvReader(isWindows = getEelDescriptor().platform.isWindows).findPythonInPythonRoot(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user