Closed FibreTTP closed 4 weeks ago
This is not the reason, Env variables are internally not stored in file form but rather converted to array form: Array<{ variable: string, value: string }>
.
This form allows for better diffing when using resource syncs. Ie the diff can show just one variables value has changed.
The config.environment
defined in resource syncs do support full line comments using either # or //
It's a bit misleading given that there's an option for the filename directly below.
Not everyone has the need to use Resource Syncs. I suggest changing this to store the field as entered, and IF a Sync updates the variables, parse for the variables and remove the comments at that time. This wouldn't affect functionality for anyone, you can still perform the diff.
I considered this, however the code complexity would be high. Of course like most feedback I do see the value here and would like to deliver. But it has to be clean and not increase complexity too much or risk more bugs.
I figured this out, next release will keep your Env file with comments intact
When saving a Stacks Environment configuration, any lines beginning with
#
are deleted. Empty lines are additionally deleted:to just
As far as I know, lines beginning with
#
are ignored by Docker, so there's no reason to be deleting them. This doesn't happen in the Compose file section.