Skip to content

fix(cli): preserve trailing dir after --template file:// URL (#245) - #250

Merged
ulises-jeremias merged 2 commits into
mainfrom
fix/245-trailing-dir-after-template-url
Jul 23, 2026
Merged

fix(cli): preserve trailing dir after --template file:// URL (#245)#250
ulises-jeremias merged 2 commits into
mainfrom
fix/245-trailing-dir-after-template-url

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Member

Summary

Fixes#245

Test plan

  • uv run pytest tests/test_cli.py in packages/create-awesome-python-app (19 passed)
  • CI green on this PR
  • After merge: tag / publish create-awesome-python-app@0.2.11 when ready

Made with Cursor

ulises-jeremiasand others added 2 commits July 23, 2026 10:28
--template file://… was incorrectly setting saw_positional, so a
trailing project_directory after --addons was treated as an addon slug.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ulises-jeremias

Copy link
Copy Markdown
MemberAuthor

Self code review

Verdict: approve / merge

Correctness

  • Root cause matches CLI 0.2.10: --template URL makes trailing project_directory look like an --addons value #245: any non-- token (including --template values like file://…) was setting saw_positional, so trailing project_directory after --addons was never peeled.
  • _VALUE_TAKING_FLAGS covers the value-taking CLI options used before Typer parse (--template/-t, --set, --pin, --refresh, --cache-dir, --fixture, plus --addons/--extend).
  • Existing peel behavior (len(values) >= 2 at EOS) preserved; prior 0.2.9 cases remain covered by tests.

Tests

  • New test_expand_preserves_dir_after_template_file_url covers the issue repro, space-separated addons after file://, and -t.
  • Local + CI test / scaffold smoke green.

Notes (non-blocking)

  • --addons/--extend in the frozenset are mostly defensive (those flags take the dedicated branch); harmless.
  • Boolean flags (--force, --no-install, …) correctly are not in the set, so a following path still counts as the positional.

CI is green including markdownlint + MegaLinter. Merging and tagging create-awesome-python-app@0.2.11.

@ulises-jeremias
ulises-jeremias merged commit b82d7dd into mainJul 23, 2026
15 checks passed
@ulises-jeremias
ulises-jeremias deleted the fix/245-trailing-dir-after-template-url branch July 23, 2026 13:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI 0.2.10: --template URL makes trailing project_directory look like an --addons value

1 participant

@ulises-jeremias