You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8152248
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): tolerate safe leftovers in smpy new dest (#148) (#150)
`smpy new --dest .` was refusing any non-empty destination, so the
common `gh repo create myapp && cd myapp && smpy new myapp --dest .`
flow blew up the moment `.git/`, `.gitignore`, or `README.md` was
present. Closes#148.
Scaffolding now tolerates a small allowlist (`SAFE_PRESERVED_NAMES`:
`.git/`, `.gitignore`, `.gitattributes`, `README*`, `LICENSE*`,
`COPYING`, `CHANGELOG.md`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`,
`.claude/`, `.vscode/`, `.idea/`, `.editorconfig`, `.DS_Store`) at the
scaffold target. When the scaffold would write over a tolerated
pre-existing file, the scaffold's copy is skipped — the user's file
wins. Any other pre-existing entry still raises `FileExistsError`,
naming the colliding files so the user knows what to move aside.
`create_workspace` / `create_host` accept a `preserve_existing` set
and return the list of preserved paths; `create_app_project` returns
`(host_dir, preserved)`; `new.py` surfaces a `Preserved existing
files` notice listing what was skipped so users can merge content in
by hand.
Three regression tests in test_cli_new_dest_tolerance.py cover:
workspace mode tolerates a fresh `git init` layout (and user files
survive), flat mode does the same, and unrelated files still
hard-fail without being touched.
https://claude.ai/code/session_01K84RjsX1ToXorMyuaxNBT6
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments