mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-86007 Run the Hatch CLI from the first existing parent folder in the path.
Initially, the ~/PycharmProjects folder does not exist. When we create the first project at ~/PycharmProjects/PythonProject, we can’t run Hatch from its parent folder and have to detect the actual root path instead. GitOrigin-RevId: 89024b6c442ee46051bc0492609eab5928807ded
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8ca39f99c0
commit
898ca7f779
@@ -72,7 +72,7 @@ class HatchViewModel<P : PathHolder>(
|
||||
val projectPath = projectPathFlows.projectPathWithDefault.first()
|
||||
val hatchExecutablePath = (hatchExecutable as? BinOnEel)?.path
|
||||
?: return@withContext Result.failure(HatchUIError.HatchExecutablePathIsNotValid(hatchExecutable.toString()))
|
||||
val hatchWorkingDirectory = if (projectPath.isDirectory()) projectPath else projectPath.parent
|
||||
val hatchWorkingDirectory = generateSequence(projectPath) { it.parent }.firstOrNull { it.isDirectory() }
|
||||
val hatchService = hatchWorkingDirectory.getHatchService(hatchExecutablePath).getOr { return@withContext it }
|
||||
|
||||
val hatchEnvironments = hatchService.findVirtualEnvironments().getOr { return@withContext it }
|
||||
|
||||
Reference in New Issue
Block a user