fix: Remove redeclaration of cfg variable in cmd/root.go

This commit is contained in:
Arik Jones (aider)
2024-09-22 17:07:57 -05:00
parent 71f63ddaa8
commit 31e0fa5ea4

View File

@@ -7,7 +7,6 @@ import (
var (
configFile string
cfg *config.Config
verbose bool
)
@@ -19,10 +18,10 @@ Use subcommands to perform specific operations.`,
}
func Execute(conf *config.Config) error {
cfg = conf
if cfg == nil {
cfg = &config.Config{} // Use an empty config if none is provided
if conf == nil {
conf = &config.Config{} // Use an empty config if none is provided
}
cfg = conf // Set the cfg variable in cmd/files.go
return rootCmd.Execute()
}