Skip to content

Commit

Permalink
fix(which): search config file paths even if AQUA_CONFIG is given
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Nov 4, 2024
1 parent 7d61998 commit d73164f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/which/which.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ type FindResult struct {
}

func (c *Controller) Which(ctx context.Context, logE *logrus.Entry, param *config.Param, exeName string) (*FindResult, error) {
for _, cfgFilePath := range c.configFinder.Finds(param.PWD, param.ConfigFilePath) {
var filePaths []string
if param.ConfigFilePath != "" {
filePaths = []string{param.ConfigFilePath}
}
for _, cfgFilePath := range append(filePaths, c.configFinder.Finds(param.PWD, "")...) {
findResult, err := c.findExecFile(ctx, logE, param, cfgFilePath, exeName)
if err != nil {
return nil, err
Expand Down

0 comments on commit d73164f

Please sign in to comment.