Allow license files to have extensions

License files can have extensions and sometimes this has meaning
like:
- LICENSE.txt
- LICENSE.GPL2
- LICENSE.LGPL2.1
This commit is contained in:
Matt Farina
2015-10-19 10:13:59 -04:00
parent 60602b29f0
commit d30a087734

View File

@@ -5,7 +5,7 @@ import (
"os/exec"
)
// License is the check for the go cyclo command
// License is the check for the existance of a license file
type License struct {
Dir string
Filenames []string
@@ -23,7 +23,7 @@ func (g License) Weight() float64 {
// Percentage returns 0 if no LICENSE, 1 if LICENSE
func (g License) Percentage() (float64, []FileSummary, error) {
cmd := exec.Command("find", g.Dir, "-maxdepth", "1", "-type", "f", "-name", "LICENSE")
cmd := exec.Command("find", g.Dir, "-maxdepth", "1", "-type", "f", "-name", "LICENSE*")
var out bytes.Buffer
cmd.Stdout = &out
err := cmd.Run()