Skip to content

Commit c820b53

Browse files
committed
Fix regression in cwd & env support for commands.
1 parent 134506c commit c820b53

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes
22

3+
## 0.3.1
4+
5+
Fix regression in cwd and env support for commands.
6+
37
## 0.3.0
48

59
Add support for parallelizing execution of commands in an alias.

dev_cmd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Copyright 2024 John Sirois.
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

4-
__version__ = "0.3.0"
4+
__version__ = "0.3.1"

dev_cmd/run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
from dev_cmd.project import find_pyproject_toml
2222

2323

24-
async def _invoke_command(command, extra_args, **subprocess_kwargs: Any) -> Process:
24+
async def _invoke_command(
25+
command: Command, extra_args: Iterable[str] = (), **subprocess_kwargs: Any
26+
) -> Process:
2527
args = list(command.args)
2628
if extra_args and command.accepts_extra_args:
2729
args.extend(extra_args)
@@ -30,7 +32,7 @@ async def _invoke_command(command, extra_args, **subprocess_kwargs: Any) -> Proc
3032
f"The `cwd` for command {command.name!r} does not exist: {command.cwd}"
3133
)
3234
return await asyncio.create_subprocess_exec(
33-
command.args[0], *command.args[1:], **subprocess_kwargs
35+
command.args[0], *command.args[1:], cwd=command.cwd, env=command.env, **subprocess_kwargs
3436
)
3537

3638

0 commit comments

Comments
 (0)