summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJonas Franz <info@jonasfranz.software>2018-02-12 19:20:30 +0100
committerLauris BH <lauris@nix.lv>2018-02-12 20:20:30 +0200
commitfbdc00f46461bec024026b23f85fd1933ead6a96 (patch)
tree51daef4be36704efd120817993a5581bbc6a6f19 /scripts
parent2cb4649acf73ce9a7b6c2b3f707673d89a789f46 (diff)
downloadgitea-fbdc00f46461bec024026b23f85fd1933ead6a96.tar.gz
gitea-fbdc00f46461bec024026b23f85fd1933ead6a96.zip
Updating generate-licenses.go to fetch licenses from maintained repository. (#3484)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generate-licenses.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/generate-licenses.go b/scripts/generate-licenses.go
index 03287d1dc9..15db19e70a 100644
--- a/scripts/generate-licenses.go
+++ b/scripts/generate-licenses.go
@@ -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 {