diff --git a/poethepoet/helpers/command/__init__.py b/poethepoet/helpers/command/__init__.py index 82ebf135..bc8e0093 100644 --- a/poethepoet/helpers/command/__init__.py +++ b/poethepoet/helpers/command/__init__.py @@ -55,9 +55,8 @@ def finalize_token(token_parts): for word in line: # For each token part indicate whether it is a glob + token_parts: List[Tuple[str, bool]] = [] for segment in word: - token_parts: List[Tuple[str, bool]] = [] - for element in segment: if isinstance(element, ParamExpansion): param_value = env.get(element.param_name, "") diff --git a/tests/fixtures/cmds_project/pyproject.toml b/tests/fixtures/cmds_project/pyproject.toml index fabe00c8..a36e010b 100644 --- a/tests/fixtures/cmds_project/pyproject.toml +++ b/tests/fixtures/cmds_project/pyproject.toml @@ -1,5 +1,7 @@ tool.poe.tasks.show_env = "poe_test_env" +tool.poe.tasks.ls_color = "poe_test_echo --color='always' \"a\"' b 'c" + [tool.poe.tasks.echo] cmd = "poe_test_echo POE_ROOT:$POE_ROOT ${BEST_PASSWORD}, task_args:" help = "It says what you say" diff --git a/tests/test_cmd_tasks.py b/tests/test_cmd_tasks.py index 2481c02b..6b12b07a 100644 --- a/tests/test_cmd_tasks.py +++ b/tests/test_cmd_tasks.py @@ -121,6 +121,13 @@ def test_cmd_task_with_cwd_option_arg(run_poe_subproc, poe_project_path): assert result.stderr == "" +def test_cmd_with_complex_token(run_poe_subproc): + result = run_poe_subproc("ls_color", project="cmds") + assert result.capture == "Poe => poe_test_echo --color=always 'a b c'\n" + assert result.stdout == "--color=always a b c\n" + assert result.stderr == "" + + def test_cmd_task_with_with_glob_arg_and_cwd( run_poe_subproc, poe_project_path, is_windows ):