Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete target folder before generation #180

Merged
merged 2 commits into from
Sep 7, 2021
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Jul 20, 2021

Closes #167

Simply deletes the output folder before generation, therefore removing any old files.

Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'm thinking whether bad things can happen when we delete a directory without warning.

Idea: check whether the directory contains any items that are not generated by the current CLI run. If there are such items, display them and ask the user whether to delete them.

@msujew
Copy link
Member Author

msujew commented Aug 11, 2021

@spoenemann Sure, makes sense. I added a yes/no check beforehand if the generator notices any additional files in the generated directory. For this, I had to make the whole generator async in order to interact with the console input.

@msujew msujew force-pushed the msujew/delete-folder-generate branch from ccf6add to f26716e Compare August 27, 2021 09:08
@msujew msujew force-pushed the msujew/delete-folder-generate branch from f26716e to 1a372ea Compare September 1, 2021 10:43
@msujew msujew force-pushed the msujew/delete-folder-generate branch from 1a372ea to 5f3a055 Compare September 1, 2021 10:47
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@msujew msujew merged commit dc89de7 into main Sep 7, 2021
@spoenemann spoenemann added this to the v0.2.0 milestone Sep 15, 2021
@msujew msujew added the cli CLI related issue label Nov 6, 2021
@msujew msujew deleted the msujew/delete-folder-generate branch November 6, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up previously generated files before regenerating them
2 participants