Skip to content

Commit

Permalink
Skip upm lock when specfile lists no pkgs (DX-575) (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhulbert authored Apr 17, 2024
1 parent 4fc3100 commit 354ddd3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cli/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ func maybeLock(ctx context.Context, b api.LanguageBackend, forceLock bool) bool

shouldLock := forceLock || !util.Exists(b.Lockfile) || store.HasSpecfileChanged(b)
if !shouldLock {
if packageDir := b.GetPackageDir(); packageDir != "" {
shouldLock = !util.Exists(packageDir)
if packageDir := b.GetPackageDir(); packageDir != "" && !util.Exists(packageDir) {
// Only run lock if a specfile exists and it lists at least one package.
shouldLock = util.Exists(b.Specfile) && len(b.ListSpecfile(true)) > 0
}
}

Expand Down

0 comments on commit 354ddd3

Please sign in to comment.