Allow to use env vars in config
This commit is contained in:
parent
5e6a5e23fd
commit
2b4c6d3318
4 changed files with 35 additions and 28 deletions
|
|
@ -3,6 +3,7 @@ package config
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
|
|
@ -13,6 +14,8 @@ func GetRepositoryConfig(data []byte, fileExtension string) (Configuration, erro
|
|||
var config Configuration
|
||||
var err error
|
||||
|
||||
data = []byte(os.ExpandEnv(string(data)))
|
||||
|
||||
switch fileExtension {
|
||||
case "yaml":
|
||||
err = yaml.Unmarshal(data, &config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue