Skip to content

Commit

Permalink
fix: handle pwsh correctly under linux (#10256)
Browse files Browse the repository at this point in the history
  • Loading branch information
Katze719 authored Mar 6, 2025
1 parent a01afef commit 82d91e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/poetry/console/commands/env/activate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_activate_command(self, env: Env) -> str:
elif shell in ["csh", "tcsh"]:
command, filename = "source", "activate.csh"
elif shell in ["powershell", "pwsh"]:
command, filename = ".", "Activate.ps1"
command, filename = ".", "activate.ps1"
elif shell == "cmd":
command, filename = ".", "activate.bat"
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/console/commands/env/test_activate.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def test_env_activate_prints_correct_script(
"shell, command, ext, prefix",
(
("cmd", ".", "activate.bat", ""),
("pwsh", ".", "Activate.ps1", "& "),
("powershell", ".", "Activate.ps1", "& "),
("pwsh", ".", "activate.ps1", "& "),
("powershell", ".", "activate.ps1", "& "),
),
)
@pytest.mark.skipif(not WINDOWS, reason="Only Windows shells")
Expand Down

0 comments on commit 82d91e4

Please sign in to comment.