1
0
mirror of https://github.com/offen/docker-volume-backup.git synced 2025-11-23 21:44:40 +02:00

Conf files should expand env vars (#363)

This commit is contained in:
Frederik Ring
2024-02-15 12:04:44 +01:00
committed by GitHub
parent 37f9bd9a8f
commit a01fc3df3f
3 changed files with 7 additions and 2 deletions

View File

@@ -69,7 +69,11 @@ func loadEnvFiles(directory string) ([]configFile, error) {
continue
}
p := filepath.Join(directory, item.Name())
envFile, err := godotenv.Read(p)
f, err := os.ReadFile(p)
if err != nil {
return nil, fmt.Errorf("loadEnvFiles: error reading %s: %w", item.Name(), err)
}
envFile, err := godotenv.Unmarshal(os.ExpandEnv(string(f)))
if err != nil {
return nil, fmt.Errorf("loadEnvFiles: error reading config file %s: %w", p, err)
}