Skip to content

Commit

Permalink
Merge pull request #1371 from stormentt/fix-no-config-panic
Browse files Browse the repository at this point in the history
fix a bug where not having a config results in a panic
  • Loading branch information
hiddeco authored Dec 15, 2023
2 parents 105cda1 + 7026838 commit 0edeb3b
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 0edeb3b

Please sign in to comment.