Skip to content

Commit

Permalink
[Fixed] Scan transitive Yarn v2+ dependencies
Browse files Browse the repository at this point in the history
Previously, only direct dependencies were considered
  • Loading branch information
Kurt-von-Laven committed Oct 4, 2022
1 parent 0614158 commit 0115445
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/license_finder/package_managers/yarn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(options = {})
@yarn_options = options[:yarn_options]
end

SHELL_COMMAND = 'yarn licenses list --json'
SHELL_COMMAND = 'yarn licenses list --recursive --json'

def possible_package_paths
[project_path.join('yarn.lock')]
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/license_finder/package_managers/yarn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ module LicenseFinder
it 'an error is raised' do
allow(SharedHelpers::Cmd).to receive(:run).with(Yarn::SHELL_COMMAND + " --no-progress --cwd #{Pathname(root)}").and_return([nil, 'error', cmd_failure])

expect { subject.current_packages }.to raise_error(/Command 'yarn licenses list --json --no-progress --cwd #{Pathname(root)}' failed to execute: error/)
expect { subject.current_packages }.to raise_error(/Command 'yarn licenses list --recursive --json --no-progress --cwd #{Pathname(root)}' failed to execute: error/)
end
end
end
Expand Down

0 comments on commit 0115445

Please sign in to comment.