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

chore: create-payload-app overwrites existing env variables #10636

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JessChowdhury
Copy link
Member

@JessChowdhury JessChowdhury commented Jan 17, 2025

What?

Using create-payload-app to initialize Payload in an existing Next.js app overwrites any existing data in the .env and .env.example files.

The desired behavior is for Payload variables to get added and with no client data lost.

How?

Updates manageEnvFiles to check for existing .env / .env.example file and appends or creates as necessary.

Adds tests to packages/create-payload-app/src/lib/create-project.spec.ts.

Fixes #10355

@JessChowdhury JessChowdhury changed the title fix(create-payload-app): existing env variables getting overwritten chore: create-payload-app overwrites existing env variables Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create-payload-app in existing Next.js project replaces .env and .env.example contents
1 participant