Skip to content

Commit

Permalink
Merge pull request #788 from aquaproj/fix/read-global-config
Browse files Browse the repository at this point in the history
fix: pass global configuration file paths in list and generate command
  • Loading branch information
suzuki-shunsuke committed May 24, 2022
2 parents 9d68c54 + 5d12693 commit f23bd7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@ jobs:
- run: git diff aqua.yaml
working-directory: tests

# Test if global configuration files are read in `aqua list` and `aqua g`
- run: aqua g suzuki-shunsuke/cmdx
working-directory: /tmp
- run: aqua list
working-directory: /tmp

- run: aqua-installer -v v0.8.1 -i /tmp/aqua
2 changes: 1 addition & 1 deletion pkg/controller/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func New(configFinder finder.ConfigFinder, configReader reader.ConfigReader, reg
// If no package is specified, the interactive fuzzy finder is launched.
// If the package supports, the latest version is gotten by GitHub API.
func (ctrl *Controller) Generate(ctx context.Context, logE *logrus.Entry, param *config.Param, args ...string) error {
cfgFilePath, err := ctrl.configFinder.Find(param.PWD, param.ConfigFilePath)
cfgFilePath, err := ctrl.configFinder.Find(param.PWD, param.ConfigFilePath, param.GlobalConfigFilePaths...)
if err != nil {
return err //nolint:wrapcheck
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewController(configFinder finder.ConfigFinder, configReader reader.ConfigR

func (ctrl *Controller) List(ctx context.Context, param *config.Param, logE *logrus.Entry) error {
cfg := &config.Config{}
cfgFilePath, err := ctrl.configFinder.Find(param.PWD, param.ConfigFilePath)
cfgFilePath, err := ctrl.configFinder.Find(param.PWD, param.ConfigFilePath, param.GlobalConfigFilePaths...)
if err != nil {
return err //nolint:wrapcheck
}
Expand Down

0 comments on commit f23bd7f

Please sign in to comment.