Actual behavior
If two profiles define the same environment variable and both profiles are loaded, the last profile wins and overwrites the earlier loaded environment variables.
Expected behavior
An error message / warning is shown when one profile overwrites a variable set by another profile during the same load command.
Additional notes
- The check should only be performed during one load operation (e.g.
envManager load profA profB)
- It is particularly easy to "achieve" this with directory mappings since they are another redirection
- This condition can probably also be reached via dependencies
How to to reproduce
Config:
storage:
pass:
type: pass
profiles:
profA:
storage: pass
path: credA
constEnv:
CONST_ENV: i-am-from-profile-A
profB:
storage: pass
path: credB
constEnv:
CONST_ENV: i-am-from-profile-B
directoryMapping:
/tmp:
- profA
- profB
- Run
envManager load profA profB and you see CONST_ENV=i-am-from-profile-B. Swap the profile names and you see the value of profile A
- Run
envManager load while in /tmp and see again the value from profile B
Actual behavior
If two profiles define the same environment variable and both profiles are loaded, the last profile wins and overwrites the earlier loaded environment variables.
Expected behavior
An error message / warning is shown when one profile overwrites a variable set by another profile during the same load command.
Additional notes
envManager load profA profB)How to to reproduce
Config:
envManager load profA profBand you seeCONST_ENV=i-am-from-profile-B. Swap the profile names and you see the value of profile AenvManager loadwhile in/tmpand see again the value from profile B