ISSUE-13 - Ignore comment prefix in envfiles

This commit is contained in:
Adrian SALAS
2022-05-21 09:53:33 +02:00
parent 22ef9211ec
commit 910281c1c7

View File

@@ -50,8 +50,10 @@ func (c *ConfigMap) AddEnvFile(file string) error {
lines := strings.Split(string(content), "\n")
for _, l := range lines {
//Check if the line is a comment
isComment := strings.HasPrefix(l, "#")
l = strings.TrimSpace(l)
if len(l) == 0 {
if len(l) == 0 || isComment {
continue
}
parts := strings.SplitN(l, "=", 2)