ISSUE-13 - Ignore comment prefix in envfiles (#15)
Co-authored-by: Adrian SALAS <adrian.salas@smile.fr> fix #13
This commit is contained in:
@@ -50,8 +50,10 @@ func (c *ConfigMap) AddEnvFile(file string) error {
|
|||||||
|
|
||||||
lines := strings.Split(string(content), "\n")
|
lines := strings.Split(string(content), "\n")
|
||||||
for _, l := range lines {
|
for _, l := range lines {
|
||||||
|
//Check if the line is a comment
|
||||||
|
isComment := strings.HasPrefix(l, "#")
|
||||||
l = strings.TrimSpace(l)
|
l = strings.TrimSpace(l)
|
||||||
if len(l) == 0 {
|
if len(l) == 0 || isComment {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
parts := strings.SplitN(l, "=", 2)
|
parts := strings.SplitN(l, "=", 2)
|
||||||
|
Reference in New Issue
Block a user