-
Notifications
You must be signed in to change notification settings - Fork 11
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
typo generator wipes out directory where it puts the generated code (targetDir) #76
Comments
Yeah sorry, there was a very explicit warning about this which disappeared in the last documentation update. I'll update with clear instructions on how to handle this tomorrow hopefully, not on a computer today. As a workaround just generate the source somewhere else and move it manually |
Just a suggestion, maybe the default should not be to delete the directory. |
I'm thinking about a better approach here, but haven't found it quite yet. Typo needs to be able to delete outdated files in the folder(s) you tell it you write to, so effectively it needs to control the whole folder and delete unknown files. What I do is I add another source directory to the build and generate into it. That pattern is solid and would just need to be documented better. But there is still the possibility of data loss if people do the obvious thing |
I ended up placing the code in target/scala-3.3.1/typo/main/scala and I added this path to the source paths in build.sbt with I think I am good - we can close this thread. |
Hi,
I have the following generator:
I have a play framework project and I want to place the generated code in a package under app. As is, the generator wiped out the content of the app folder (it included the controllers code and others) which was somewhat unexpected. I thought the generator would remove the
typo
folder recursively. Luckily, I use IntelliJ and I was able to restore the deleted code. It is a brand new project and I didn't add the code yet to git until now after this accident.Are there any options that allow me to tell the generator not to wipe out the content of the app folder, i.e. the content of targetDir?
For now, I am going to add the generated code somewhere under: target/scala-3.3.1\typo.
Thanks
The text was updated successfully, but these errors were encountered: