Method: LicenseFinder::Composer#composer_json

Defined in:
lib/license_finder/package_managers/composer.rb

#composer_jsonObject



55
56
57
58
59
60
61
# File 'lib/license_finder/package_managers/composer.rb', line 55

def composer_json
  command = "composer licenses --format=json#{@check_require_only ? ' --no-dev' : ''}"
  stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(command) }
  raise "Command '#{command}' failed to execute: #{stderr}" unless status.success?

  JSON(stdout)
end