Include all aptly contributors in man section AUTHORS.

This commit is contained in:
Andrey Smirnov
2015-07-04 13:16:15 +03:00
parent 205297d0b8
commit 698e239f45
3 changed files with 75 additions and 2 deletions
+22
View File
@@ -5,6 +5,7 @@ import (
"github.com/smira/aptly/cmd"
"github.com/smira/commander"
"github.com/smira/flag"
"io/ioutil"
"log"
"os"
"os/exec"
@@ -43,6 +44,12 @@ func capitalize(s string) string {
return strings.Join(parts, " ")
}
var authorsS string
func authors() string {
return authorsS
}
func main() {
command := cmd.RootCommand()
command.UsageLine = "aptly"
@@ -56,9 +63,24 @@ func main() {
"findCommand": findCommand,
"toUpper": strings.ToUpper,
"capitalize": capitalize,
"authors": authors,
})
template.Must(templ.ParseFiles(filepath.Join(filepath.Dir(_File), "aptly.1.ronn.tmpl")))
authorsF, err := os.Open(filepath.Join(filepath.Dir(_File), "..", "AUTHORS"))
if err != nil {
log.Fatal(err)
}
authorsB, err := ioutil.ReadAll(authorsF)
if err != nil {
log.Fatal(err)
}
authorsF.Close()
authorsS = string(authorsB)
output, err := os.Create(filepath.Join(filepath.Dir(_File), "aptly.1.ronn"))
if err != nil {
log.Fatal(err)