Automate go licence fetching
This commit is contained in:
parent
e6b6298833
commit
90cf5a5815
4 changed files with 4616 additions and 0 deletions
8
licences/fetch_licences.sh
Normal file
8
licences/fetch_licences.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
||||||
|
TPL_LOCATION="$SCRIPT_DIR/template.html"
|
||||||
|
STATIC_LOCATION="$SCRIPT_DIR/../static/licences.html"
|
||||||
|
PROJECT_URL="git.readonly.ch/bouzoure/pop-camarades"
|
||||||
|
|
||||||
|
go-licenses report "$PROJECT_URL" --template "$TPL_LOCATION" > "$STATIC_LOCATION"
|
||||||
3
licences/install_tool.sh
Normal file
3
licences/install_tool.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
go install github.com/google/go-licenses@latest
|
||||||
39
licences/template.html
Normal file
39
licences/template.html
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Licences</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: serif;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
background-color: lightgrey;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{{ range . }}
|
||||||
|
<div>
|
||||||
|
<h3>{{ .Name }}</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Name: {{ .Name }}</li>
|
||||||
|
<li>Version: {{ .Version }}</li>
|
||||||
|
<li>
|
||||||
|
License:
|
||||||
|
{{ if ne .LicenseURL "Unknown" }}
|
||||||
|
<a href="{{ .LicenseURL }}">
|
||||||
|
{{ .LicenseName }}
|
||||||
|
</a>
|
||||||
|
{{ else }}
|
||||||
|
{{ .LicenseName }}
|
||||||
|
{{ end }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<pre>{{ .LicenseText }}</pre>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
4566
static/licences.html
Normal file
4566
static/licences.html
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue