You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Proposal: Enhancements for Syncing .env Files
Objective:
Improve the functionality of our CLI tool that synchronises .env files to .example.env files by providing an escape mechanism to preserve specific values for public variables.
Problem:
Currently, all variables in the .example.env file exist as empty strings after the syncing process. It would be helpful for public variables to retain their values.
Proposed Solution:
I thought of two way to achive this:
Public Prefix Preservation: Allow users to specify a custom or default prefix for variable names that they want to remain public. Any variable with this prefix will retain its value during the sync process.
CLI Example:
sync-dotenv --preserve-public-prefix=NEXT_PUBLIC
In this example, any variable starting with NEXT_PUBLIC will keep its original value in the .example.env file.
Default behavior (when flag is used without a value): An error will be thrown requesting for a prefix input.
Keyword Comment Preservation: Allow users to mark variables for preservation using a default or custom keyword comment at the end of the line.
Feature Proposal: Enhancements for Syncing .env Files
Objective:
Improve the functionality of our CLI tool that synchronises
.env
files to.example.env
files by providing an escape mechanism to preserve specific values for public variables.Problem:
Currently, all variables in the
.example.env
file exist as empty strings after the syncing process. It would be helpful for public variables to retain their values.Proposed Solution:
I thought of two way to achive this:
Public Prefix Preservation: Allow users to specify a custom or default prefix for variable names that they want to remain public. Any variable with this prefix will retain its value during the sync process.
CLI Example:
In this example, any variable starting with
NEXT_PUBLIC
will keep its original value in the.example.env
file.Default behavior (when flag is used without a value): An error will be thrown requesting for a prefix input.
Keyword Comment Preservation: Allow users to mark variables for preservation using a default or custom keyword comment at the end of the line.
.env
file Example:CLI Example:
In this example, any variable line ending with
#SYNC_VALUE
will keep its original value in the.example.env
file.Default behavior (when flag is used without a value): An error will be thrown requesting for a keyword input.
Considerations:
Need to ensure these changes are well documented in the CLI help text.
Need to provide examples in the readme for the new flag and potential use cases.
Error handling needs to be designed carefully to provide meaningful error messages, especially when the new flags are used without necessary inputs.
The text was updated successfully, but these errors were encountered: