NewConfigLoader creates a new config loader with the given options
(configPath string)
| 78 | |
| 79 | // NewConfigLoader creates a new config loader with the given options |
| 80 | func NewConfigLoader(configPath string) (ConfigLoader, error) { |
| 81 | if configPath == "" { |
| 82 | configPath = os.Getenv("DEVSPACE_CONFIG") |
| 83 | } |
| 84 | |
| 85 | absPath, err := filepath.Abs(ConfigPath(configPath)) |
| 86 | if err != nil { |
| 87 | return nil, err |
| 88 | } |
| 89 | |
| 90 | return &configLoader{ |
| 91 | absConfigPath: absPath, |
| 92 | }, nil |
| 93 | } |
| 94 | |
| 95 | func (l *configLoader) ConfigPath() string { |
| 96 | return l.absConfigPath |