feat(init): allow manim init project into an existing folder#4858
Open
Chessing234 wants to merge 2 commits into
Open
feat(init): allow manim init project into an existing folder#4858Chessing234 wants to merge 2 commits into
manim init project into an existing folder#4858Chessing234 wants to merge 2 commits into
Conversation
Contributor
|
I think it should be possible to even target folders with conflicting files, by just overriding the existing file(s). |
Previously `manim init project` refused any existing directory, so the common `uv init . && manim init project .` flow failed. Only refuse when a file we would create (manim.cfg/main.py) already exists; otherwise create the files in the existing folder. Closes ManimCommunity#4693 Co-authored-by: Cursor <cursoragent@cursor.com>
b145c84 to
8b19db3
Compare
Author
|
Good call. I've updated it so a conflicting I kept a prompt (defaulting to no) instead of overwriting silently, since |
Prompt before overwriting an existing manim.cfg/main.py so initializing into a folder that already has project files is possible, per review feedback. Co-authored-by: Cursor <cursoragent@cursor.com>
dd76593 to
4485f78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
manim init projectrefused to run whenever the target directory already existed, breaking the natural flow suggested in Allowmanim init projectinto existing folder #4693:manim.cfg/main.py) already exists in the target folder; otherwise it initializes into the existing folder (creating it if needed).Closes #4693
Test plan
pytest tests/interface/test_commands.py -k inittest_manim_init_project_existing_folder— initializes into a pre-existing, non-conflicting foldertest_manim_init_project_conflicting_files— refuses and leaves an existingmain.pyuntouchedMade with Cursor