mirror of
https://github.com/foomo/posh-providers.git
synced 2025-10-16 12:35:41 +00:00
Merge pull request #126 from foomo/pivotal-license-finder-sources
feat(pivotal/licensefinder): add sources config
This commit is contained in:
commit
fbc4f2b788
@ -18,5 +18,8 @@ func New(l log.Logger) (plugin.Plugin, error) {
|
||||
licenseFinder:
|
||||
logPath: .posh/logs/licenses.log
|
||||
decisionsPath: .posh/licenses.yaml
|
||||
sources:
|
||||
- go.mod
|
||||
- yarn.lock
|
||||
```
|
||||
|
||||
|
||||
@ -239,8 +239,9 @@ func (c *Command) execute(ctx context.Context, r *readline.Readline, args ...str
|
||||
|
||||
func (c *Command) aggregatePaths(ctx context.Context) string {
|
||||
var paths []string
|
||||
paths = append(paths, c.paths(ctx, "go.sum")...)
|
||||
paths = append(paths, c.paths(ctx, "yarn.lock")...)
|
||||
for _, file := range c.cfg.Sources {
|
||||
paths = append(paths, c.paths(ctx, file)...)
|
||||
}
|
||||
paths = lo.Uniq(paths)
|
||||
sort.Strings(paths)
|
||||
c.l.Info("Aggregating liceses from:")
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package licensefinder
|
||||
|
||||
type Config struct {
|
||||
LogPath string `json:"logPath" yaml:"logPath"`
|
||||
DecisionsPath string `json:"decisionsPath" yaml:"decisionsPath"`
|
||||
LogPath string `json:"logPath" yaml:"logPath"`
|
||||
DecisionsPath string `json:"decisionsPath" yaml:"decisionsPath"`
|
||||
Sources []string `json:"sources" yaml:"sources"`
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user