Updating generate-licenses.go to fetch licenses from maintained repository. (#3484)

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz
2018-02-12 19:20:30 +01:00
committed by Lauris BH
parent 2cb4649acf
commit fbdc00f464
317 changed files with 8222 additions and 17499 deletions

View File

@ -20,7 +20,7 @@ import (
func main() {
var (
prefix = "gitea-licenses"
url = "https://api.github.com/repos/spdx/license-list/tarball"
url = "https://api.github.com/repos/spdx/license-list-data/tarball"
destination = ""
)
@ -70,6 +70,10 @@ func main() {
log.Fatalf("Failed to iterate archive. %s", err)
}
if !strings.Contains(hdr.Name, "/text/") {
continue
}
if filepath.Ext(hdr.Name) != ".txt" {
continue
}
@ -81,7 +85,6 @@ func main() {
if strings.HasPrefix(filepath.Base(hdr.Name), "deprecated_") {
continue
}
out, err := os.Create(path.Join(destination, strings.TrimSuffix(filepath.Base(hdr.Name), ".txt")))
if err != nil {