Skip to content

Commit

Permalink
[Added] Provide homepage information for GoDep and Go15Vendor package…
Browse files Browse the repository at this point in the history
… managers

Signed-off-by: Parv Mital <pmital@pivotal.io>
  • Loading branch information
Pivotal-Jeff-Jun authored and pivotal-pmital committed Mar 5, 2021
1 parent c8614d7 commit bae1bda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/license_finder/package_managers/dep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ def current_packages
GoPackage.from_dependency({
'ImportPath' => project['name'],
'InstallPath' => project_path.join('vendor', project['name']),
'Rev' => project['revision']
'Rev' => project['revision'],
'Homepage' => repo_name(project['name'])
}, nil, true)
end
end

def repo_name(name)
name.split('/')[0..2].join('/')
end

def self.takes_priority_over
Go15VendorExperiment
end
Expand Down
7 changes: 6 additions & 1 deletion lib/license_finder/package_managers/go_15vendorexperiment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ def current_packages
GoPackage.from_dependency({
'ImportPath' => dep,
'InstallPath' => detected_package_path.join(dep),
'Rev' => 'vendored-' + project_sha(detected_package_path.join(dep))
'Rev' => 'vendored-' + project_sha(detected_package_path.join(dep)),
'Homepage' => repo_name(dep['ImportPath'])
}, nil, true)
end
end

def repo_name(name)
name.split('/')[0..2].join('/')
end

def package_management_command
'go'
end
Expand Down

0 comments on commit bae1bda

Please sign in to comment.