Skip to content

Commit

Permalink
feat: add --check flag to the update command
Browse files Browse the repository at this point in the history
Signed-off-by: hanshal101 <[email protected]>
  • Loading branch information
hanshal101 authored and hanshal101 committed Jul 3, 2024
1 parent f9d61df commit 65f0b7c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions pkg/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,12 @@ func ComparePackages(a, b []string) bool {
return false
}

counts := make(map[string]int)
counts := make(map[string]bool)
for _, item := range a {
counts[item]++
counts[item] = true
}
for _, item := range b {
if counts[item] == 0 {
return false
}
counts[item]--
}

for _, count := range counts {
if count != 0 {
if counts[item] {
return false
}
}
Expand Down

0 comments on commit 65f0b7c

Please sign in to comment.