mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 08:30:50 +00: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:
parent
2cb4649acf
commit
fbdc00f464
317 changed files with 8222 additions and 17499 deletions
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue