fix: detect poetry env outside of poetry shell (#49)
If you are not in a `poetry shell`, the venv detection does not work. This patch prepends `poetry run` before `poetry env info -p`, which makes venv detection work both inside and outside the poetry subshell.
This commit is contained in:
@@ -56,7 +56,7 @@ function M.get_python_command(root)
|
||||
if lib.files.exists("pyproject.toml") then
|
||||
local success, exit_code, data = pcall(
|
||||
lib.process.run,
|
||||
{ "poetry", "env", "info", "-p" },
|
||||
{ "poetry", "run", "poetry", "env", "info", "-p" },
|
||||
{ stdout = true }
|
||||
)
|
||||
if success and exit_code == 0 then
|
||||
|
Reference in New Issue
Block a user