Skip to content

Commit c6d3537

Browse files
authored
env activate: fallback to POSIX compatible builtin (#10696)
1 parent ba73d18 commit c6d3537

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/poetry/console/commands/env/activate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ def _get_activate_command(self, env: Env, shell: str) -> str:
5151
command, filename = ".", "activate.ps1"
5252
elif shell == "cmd":
5353
command, filename = ".", "activate.bat"
54-
else:
54+
elif shell in ["bash", "mksh", "zsh"]:
5555
command, filename = "source", "activate"
56+
else:
57+
command, filename = ".", "activate"
5658

5759
if (activation_script := env.bin_dir / filename).exists():
5860
if WINDOWS:

tests/console/commands/env/test_activate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def tester(command_tester_factory: CommandTesterFactory) -> CommandTester:
2424
@pytest.mark.parametrize(
2525
"shell, command, ext",
2626
(
27+
("dash", ".", ""),
2728
("bash", "source", ""),
2829
("zsh", "source", ""),
2930
("fish", "source", ".fish"),

0 commit comments

Comments
 (0)