diff options
author | Thomas Boerger <thomas@webhippie.de> | 2017-03-15 16:11:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 16:11:26 +0100 |
commit | 780cb692d64edfadea6f79fbbad2ef033cdbe796 (patch) | |
tree | 1b0f574eb62432cbbb45358994e842f8efdba38a /scripts/generate-licenses.go | |
parent | 42032fdecf81c25cb4aa477ddf9a0207e85f571a (diff) | |
download | gitea-780cb692d64edfadea6f79fbbad2ef033cdbe796.tar.gz gitea-780cb692d64edfadea6f79fbbad2ef033cdbe796.zip |
Make sure both scripts/ can live side by side (#1264)
Diffstat (limited to 'scripts/generate-licenses.go')
-rw-r--r-- | scripts/generate-licenses.go | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/scripts/generate-licenses.go b/scripts/generate-licenses.go index c99cdb3651..03287d1dc9 100644 --- a/scripts/generate-licenses.go +++ b/scripts/generate-licenses.go @@ -1,4 +1,4 @@ -// +build !build +// +build ignore package main @@ -17,17 +17,14 @@ import ( "strings" ) -var ( - prefix = "gitea-licenses" - url = "https://api.github.com/repos/spdx/license-list/tarball" - destination = "" -) +func main() { + var ( + prefix = "gitea-licenses" + url = "https://api.github.com/repos/spdx/license-list/tarball" + destination = "" + ) -func init() { flag.StringVar(&destination, "dest", "options/license/", "destination for the licenses") -} - -func main() { flag.Parse() file, err := ioutil.TempFile(os.TempDir(), prefix) @@ -73,9 +70,6 @@ func main() { log.Fatalf("Failed to iterate archive. %s", err) } - fmt.Println(hdr.Name) - fmt.Println(filepath.Ext(hdr.Name)) - if filepath.Ext(hdr.Name) != ".txt" { continue } @@ -88,8 +82,6 @@ func main() { continue } - fmt.Println(path.Join(destination, strings.TrimSuffix(filepath.Base(hdr.Name), ".txt"))) - out, err := os.Create(path.Join(destination, strings.TrimSuffix(filepath.Base(hdr.Name), ".txt"))) if err != nil { |