Skip to content

Commit

Permalink
fix a bug where not having a config results in a panic
Browse files Browse the repository at this point in the history
Signed-off-by: Tanner Storment <tannerstorment@gmail.com>
  • Loading branch information
stormentt authored and hiddeco committed Dec 15, 2023
1 parent 105cda1 commit 7026838
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/sops/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,11 @@ func loadStoresConfig(context *cli.Context, path string) (*config.StoresConfig,
configPath = context.String("config")
} else {
// Ignore config not found errors returned from FindConfigFile since the config file is not mandatory
configPath, _ = config.FindConfigFile(".")
foundPath, err := config.FindConfigFile(".")
if err != nil {
return config.NewStoresConfig(), nil
}
configPath = foundPath
}
return config.LoadStoresConfig(configPath)
}
Expand Down

0 comments on commit 7026838

Please sign in to comment.