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
Currently the secrets env command contains different formats that get generated when it's not running a command. We need to add variants to these formats that include export within the file.
For example the unix format is structured as
ENV_ONE="one";
ENV_TWO="two";
But the new variant will include the export keyword
export ENV_ONE="one";
export ENV_TWO="two";
This should apply to all the existing formats where applicable. So if the cmd and powershell if they have a equavalent way of exporting env variables within a script then we should have a format version for them as well.
Additional context
Tasks
Add an export variant format for the unix format
Add an export variant for all other formats that can support it.
The text was updated successfully, but these errors were encountered:
This feature introduces an --env-export flag to the secrets env command, allowing it to handle environment variables in a way that ensures compatibility with child processes across multiple platforms.
Key Functionalities
1. Unix Format
Previous Behavior:
Environment variables were output as:
ENV_VAR="value"
This format sets variables but does not export them, meaning they are not available to child processes unless explicitly exported.
New Behavior with --env-export:
export ENV_VAR="value"
Adding the export prefix ensures that the variables are propagated to child processes. This is essential for scripts requiring child processes to inherit these variables.
2. Windows PowerShell
With --env-export:
Variables are set as global or session-specific based on context:
$env:ENV_VAR='value'
Without --env-export:
Variables are scoped only to the current PowerShell session:
$ENV_VAR='value'
Dynamic Updates:
The variables are immediately updated in the current session and optionally persist globally based on the flag.
3. Windows CMD
Default Behavior:
Variables are set using set commands, which inherently propagate to child processes:
setENV_VAR=value
New Behavior:
No additional export mechanism is needed since CMD already ensures propagation of variables to child processes.
Specification
Currently the
secrets env
command contains different formats that get generated when it's not running a command. We need to add variants to these formats that include export within the file.For example the
unix
format is structured asBut the new variant will include the export keyword
This should apply to all the existing formats where applicable. So if the cmd and powershell if they have a equavalent way of exporting env variables within a script then we should have a format version for them as well.
Additional context
Tasks
unix
formatThe text was updated successfully, but these errors were encountered: