strip quotes from env vars

This commit is contained in:
Levi Neely 2026-05-21 19:12:56 +02:00
parent 8960cd9754
commit 09afd071ed
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ func loadEnvFile(path string) {
v = v[:i] v = v[:i]
} }
v = strings.TrimSpace(v) v = strings.TrimSpace(v)
if len(v) >= 2 && (v[0] == '"' && v[len(v)-1] == '"' || v[0] == '\'' && v[len(v)-1] == '\'') {
v = v[1 : len(v)-1]
}
if k != "" && os.Getenv(k) == "" { if k != "" && os.Getenv(k) == "" {
os.Setenv(k, v) os.Setenv(k, v)
} }