helloShen / leetcode-helper

Save your time from building scaffolding for each leetcode problem.
345 stars 43 forks source link

[feature] Prevent files from being overwritten #6

Closed LiZeC123 closed 5 years ago

LiZeC123 commented 5 years ago

Today I used this project to create a folder for a question. When I was ready to do the next question, I modified the configuration file, but forgot to save it. So when I executed the create command ant generate, the new file created overwrites my original code file.

Therefore, you should check if the specified file exists before creating a new file. I don't know much about how ant works, so I can't implement this feature myself, but this article may be helpful to you.

Do I have a way to check the existence of a directory in Ant (not a file)?

LiZeC123 commented 5 years ago

And This story tells us that all the code files should be managed under git. sad :cold_sweat:

helloShen commented 5 years ago

Nice tips, let me fix it, thx.

helloShen commented 5 years ago

Problem fixed. Let me know if anything wrong.

LiZeC123 commented 5 years ago

This update solves many problems and there are no problems at present.