Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to specify the db file #20

Closed
vdemeester opened this issue Apr 22, 2020 · 2 comments
Closed

Add a way to specify the db file #20

vdemeester opened this issue Apr 22, 2020 · 2 comments

Comments

@vdemeester
Copy link

vdemeester commented Apr 22, 2020

In the case where I distribute the binary and the db file separately, I want to be able to specify where licenseclassifier should look for the db. This is related to go-licences (https://github.com/google/go-licenses/blob/master/licenses/classifier.go)

As of today, you need the source of the go-license binary in the right path (GOPATH, …) to be able to use it.

Another alternative would be to embedded the .db in the binary 👼

@vdemeester vdemeester changed the title Add a flag to specify the db file Add a way to specify the db file Apr 22, 2020
vdemeester added a commit to vdemeester/tektoncd-plumbing that referenced this issue Apr 22, 2020
This is a workaround, and should be fixed once
google/licenseclassifier#20 is fixed.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
tekton-robot pushed a commit to tektoncd/plumbing that referenced this issue Apr 22, 2020
This is a workaround, and should be fixed once
google/licenseclassifier#20 is fixed.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@jls5177
Copy link

jls5177 commented Jul 26, 2020

Hi @vdemeester,

I ran into this exact issue when trying to use go-licenses in a project with a custom GOPATH. I found out that this package already contains a way to adjust the Archive location using the OptionFn slice within the New() function call. https://github.com/google/licenseclassifier/blob/master/classifier.go#L89:L94

The issue is the go-licenses does not expose a way to call this from the command line. I opened a pull request (google/go-licenses#36) to fix that issue. If you are directly including the licenseclassifier module then you can do something similar to what I did in the PR.

Hope it helps.

@wcn3
Copy link
Collaborator

wcn3 commented Sep 17, 2020

Since this is an issue with the utility calling the classifier and not this code itself, closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants