mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-31 15:21:00 +08:00
Updating generate-licenses.go to fetch licenses from maintained repository. (#3484)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
7
scripts/generate-licenses.go
vendored
7
scripts/generate-licenses.go
vendored
@ -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 {
|
||||
|
Reference in New Issue
Block a user