From a00bf7e5d6a600fb4c5ebc1f2130178a1923cf87 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 26 Mar 2024 23:37:08 -0300 Subject: [PATCH] feat: support .config dir closes #4716 Signed-off-by: Carlos Alexandro Becker --- cmd/config.go | 4 +++- cmd/config_test.go | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/config.go b/cmd/config.go index 2f65f22e399..72e5c50a8ad 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -27,7 +27,9 @@ func loadConfigCheck(path string) (config.Project, string, error) { p, err := config.Load(path) return p, path, err } - for _, f := range [4]string{ + for _, f := range [6]string{ + ".config/goreleaser.yml", + ".config/goreleaser.yaml", ".goreleaser.yml", ".goreleaser.yaml", "goreleaser.yml", diff --git a/cmd/config_test.go b/cmd/config_test.go index 5552031d709..b753f36d7a9 100644 --- a/cmd/config_test.go +++ b/cmd/config_test.go @@ -11,6 +11,8 @@ import ( func TestConfigFlagNotSetButExists(t *testing.T) { for _, name := range []string{ + ".config/goreleaser.yml", + ".config/goreleaser.yaml", ".goreleaser.yml", ".goreleaser.yaml", "goreleaser.yml", @@ -18,6 +20,7 @@ func TestConfigFlagNotSetButExists(t *testing.T) { } { t.Run(name, func(t *testing.T) { folder := setup(t) + require.NoError(t, os.MkdirAll(filepath.Dir(name), 0o755)) require.NoError(t, os.Rename( filepath.Join(folder, "goreleaser.yml"), filepath.Join(folder, name),