|
|
@ -1,4 +1,4 @@ |
|
|
|
// +build !build
|
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
|
|
|
|
package main |
|
|
|
package main |
|
|
|
|
|
|
|
|
|
|
@ -17,17 +17,14 @@ import ( |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
func main() { |
|
|
|
|
|
|
|
var ( |
|
|
|
prefix = "gitea-licenses" |
|
|
|
prefix = "gitea-licenses" |
|
|
|
url = "https://api.github.com/repos/spdx/license-list/tarball" |
|
|
|
url = "https://api.github.com/repos/spdx/license-list/tarball" |
|
|
|
destination = "" |
|
|
|
destination = "" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func init() { |
|
|
|
|
|
|
|
flag.StringVar(&destination, "dest", "options/license/", "destination for the licenses") |
|
|
|
flag.StringVar(&destination, "dest", "options/license/", "destination for the licenses") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
|
|
|
flag.Parse() |
|
|
|
flag.Parse() |
|
|
|
|
|
|
|
|
|
|
|
file, err := ioutil.TempFile(os.TempDir(), prefix) |
|
|
|
file, err := ioutil.TempFile(os.TempDir(), prefix) |
|
|
@ -73,9 +70,6 @@ func main() { |
|
|
|
log.Fatalf("Failed to iterate archive. %s", err) |
|
|
|
log.Fatalf("Failed to iterate archive. %s", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fmt.Println(hdr.Name) |
|
|
|
|
|
|
|
fmt.Println(filepath.Ext(hdr.Name)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if filepath.Ext(hdr.Name) != ".txt" { |
|
|
|
if filepath.Ext(hdr.Name) != ".txt" { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
@ -88,8 +82,6 @@ func main() { |
|
|
|
continue |
|
|
|
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"))) |
|
|
|
out, err := os.Create(path.Join(destination, strings.TrimSuffix(filepath.Base(hdr.Name), ".txt"))) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|