Squashed commit of pull request #1954

This commit is contained in:
Dennis Wilson
2015-08-02 08:27:05 +02:00
committed by Jakob Borg
parent 19451e0654
commit 26d52bedb3
44 changed files with 934 additions and 800 deletions

View File

@@ -20,6 +20,8 @@ import (
"strings"
)
const htmlFile = "gui/scripts/syncthing/core/views/directives/aboutModalView.html"
func main() {
bs := readAll("AUTHORS")
lines := strings.Split(string(bs), "\n")
@@ -27,17 +29,17 @@ func main() {
authors := make([]string, 0, len(lines))
for _, line := range lines {
if m := nameRe.FindStringSubmatch(line); len(m) == 2 {
authors = append(authors, " <li class=\"auto-generated\">"+m[1]+"</li>")
authors = append(authors, " <li class=\"auto-generated\">"+m[1]+"</li>")
}
}
sort.Strings(authors)
replacement := strings.Join(authors, "\n")
authorsRe := regexp.MustCompile(`(?s)id="contributor-list">.*?</ul>`)
bs = readAll("gui/index.html")
bs = authorsRe.ReplaceAll(bs, []byte("id=\"contributor-list\">\n"+replacement+"\n </ul>"))
bs = readAll(htmlFile)
bs = authorsRe.ReplaceAll(bs, []byte("id=\"contributor-list\">\n"+replacement+"\n </ul>"))
if err := ioutil.WriteFile("gui/index.html", bs, 0644); err != nil {
if err := ioutil.WriteFile(htmlFile, bs, 0644); err != nil {
log.Fatal(err)
}
}