Skip to content

Commit

Permalink
[FEATURE] - CLI Configuration Override (#203)
Browse files Browse the repository at this point in the history
Allow for an environment variable to override the configuration file
  • Loading branch information
gambol99 committed Jul 1, 2022
1 parent 684fada commit 48960b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ func LoadConfig(filename string) (Config, error) {

// ConfigPath returns the path to the config file
func ConfigPath() string {
if os.Getenv("TNCTL_CONFIG") != "" {
return os.Getenv("TNCTL_CONFIG")
}

return filepath.Join(os.Getenv("HOME"), ".tnctl", "config.yaml")
}

0 comments on commit 48960b0

Please sign in to comment.