Skip to content

Commit 6091094

Browse files
mrnossiomcpleemergify[bot]
authored
fix: write default config in XDG config dir to avoid cluttering the HOME directory by default (#2140)
Co-authored-by: Casey Lee <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 8072a00 commit 6091094

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/root.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ func Execute(ctx context.Context, version string) {
107107
}
108108
}
109109

110+
// Return locations where Act's config can be found in order : XDG spec, .actrc in HOME directory, .actrc in invocation directory
110111
func configLocations() []string {
111112
configFileName := ".actrc"
112113

@@ -120,8 +121,8 @@ func configLocations() []string {
120121
}
121122

122123
return []string{
123-
filepath.Join(UserHomeDir, configFileName),
124124
actrcXdg,
125+
filepath.Join(UserHomeDir, configFileName),
125126
filepath.Join(".", configFileName),
126127
}
127128
}
@@ -557,6 +558,7 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
557558
}
558559
}
559560
if !cfgFound && len(cfgLocations) > 0 {
561+
// The first config location refers to the XDG spec one
560562
if err := defaultImageSurvey(cfgLocations[0]); err != nil {
561563
log.Fatal(err)
562564
}

0 commit comments

Comments
 (0)