Skip to content

fix: prevent old env variables from persisting during deployment#128

Open
Chandraveersingh1717 wants to merge 1 commit intometacall:masterfrom
Chandraveersingh1717:fix/env-vars-overwrite-on-redeploy
Open

fix: prevent old env variables from persisting during deployment#128
Chandraveersingh1717 wants to merge 1 commit intometacall:masterfrom
Chandraveersingh1717:fix/env-vars-overwrite-on-redeploy

Conversation

@Chandraveersingh1717
Copy link
Copy Markdown

Currently, the .env file is written using fs.appendFileSync. This causes
environment variables from previous deployments to remain in the file.
As a result, outdated values may persist and override the new configuration.

For example:

Old .env
PORT=3000

New deployment
PORT=8080

With appendFileSync the file becomes:

PORT=3000
PORT=8080

This PR replaces appendFileSync with writeFileSync so the .env file is
overwritten instead of appended. This ensures that only the latest
environment variables are present after deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant