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

prisma-zod-generator deletes the entire output folder! #71

Open
renanmt opened this issue Jan 19, 2023 · 1 comment
Open

prisma-zod-generator deletes the entire output folder! #71

renanmt opened this issue Jan 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@renanmt
Copy link

renanmt commented Jan 19, 2023

Bug description

I changed the output parameter to drop the files inside my src folder just to learn the generator deleted my entire day of work.
Can you please review this behavior? If the output is different from the default, DO NOT WIPE THE OUTPUT FOLDER!

How to reproduce

Change the output option in the generator to:

generator zod {
  provider = "prisma-zod-generator"
  output = "../src"
} 

Expected behavior

Lose a full day of work if you did not commit anything yet.

Prisma information

generator zod {
provider = "prisma-zod-generator"
output = "../src"
}

Environment & setup

  • OS: Windows
  • Database: PostgreSQL
  • Node.js version: v18.12.1

Prisma Version

4.5.0
@omar-dulaimi
Copy link
Owner

omar-dulaimi commented Jan 30, 2023

There was definitely a reason why this happens, I don't remember exactly why. But if it doesn't cause any other issues, we may change it to overwrite instead.

Also, usually generators outputs go into a folder where the prisma schema resides. It's always a good idea to commit early and commit often. It's a bad practice doing it like you describe.

Anyway, I should work on this maybe this weekend. Feel free to work on it if you like.

@omar-dulaimi omar-dulaimi added the enhancement New feature or request label Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants