Skip to content

Commit

Permalink
Fix yarn_berry detection during package manager instrumentation (#7117)
Browse files Browse the repository at this point in the history
The `yarn_berry?` helper receives a `DependencyFile`, not the actual
content.
  • Loading branch information
deivid-rodriguez committed Apr 19, 2023
1 parent 32811c0 commit ccd0955
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion npm_and_yarn/lib/dependabot/npm_and_yarn/file_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def yarn_version
if (package_manager = package.fetch("packageManager", nil))
get_yarn_version_from_package_json(package_manager)
elsif yarn_lock
Helpers.yarn_version_numeric(yarn_lock.content)
Helpers.yarn_version_numeric(yarn_lock)
end
end

Expand Down
4 changes: 2 additions & 2 deletions npm_and_yarn/lib/dependabot/npm_and_yarn/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def self.npm_version_numeric(lockfile_content)
6
end

def self.yarn_version_numeric(lockfile_content)
if yarn_berry?(lockfile_content)
def self.yarn_version_numeric(yarn_lock)
if yarn_berry?(yarn_lock)
3
else
1
Expand Down

0 comments on commit ccd0955

Please sign in to comment.