Skip to content

Commit

Permalink
Additional fix with deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonTClipp committed Jan 20, 2025
1 parent f8c43c6 commit c92dd2e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cmd/mockery.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ func (r *RootApp) Run() error {
boilerplate = string(data)
}

if r.Config.Packages == nil {
configuredPackages, err := r.Config.GetPackages(ctx)
if err != nil && !errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("failed to determine configured packages: %w", err)
}
if len(configuredPackages) == 0 {
logging.WarnDeprecated(
"packages",
"use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature.",
Expand All @@ -241,13 +245,7 @@ func (r *RootApp) Run() error {
"migration": logging.DocsURL("/migrating_to_packages/"),
},
)
}

configuredPackages, err := r.Config.GetPackages(ctx)
if err != nil && !errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("failed to determine configured packages: %w", err)
}
if len(configuredPackages) != 0 {
} else {
r.Config.LogUnsupportedPackagesConfig(ctx)

configuredPackages, err := r.Config.GetPackages(ctx)
Expand Down

0 comments on commit c92dd2e

Please sign in to comment.