diff options
| author | Christine Dodrill <me@christine.website> | 2020-11-04 20:02:14 +0000 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2020-11-04 20:02:34 +0000 |
| commit | fffe0a3eda6fe50ef5d72e9a419b74e2be1f02fe (patch) | |
| tree | 110ac4f5f7ad0cf3379a893f2d0e11816a5ef3de | |
| parent | 9a04291328efc8ea3ebd4014d97ca16c7f12865a (diff) | |
| download | x-fffe0a3eda6fe50ef5d72e9a419b74e2be1f02fe.tar.xz x-fffe0a3eda6fe50ef5d72e9a419b74e2be1f02fe.zip | |
update
| -rw-r--r-- | cmd/priorworkgen/main.go | 37 | ||||
| -rw-r--r-- | go.mod | 1 | ||||
| -rw-r--r-- | go.sum | 5 |
3 files changed, 26 insertions, 17 deletions
diff --git a/cmd/priorworkgen/main.go b/cmd/priorworkgen/main.go index f6b5bf9..532aef3 100644 --- a/cmd/priorworkgen/main.go +++ b/cmd/priorworkgen/main.go @@ -4,9 +4,7 @@ package main import ( "context" "flag" - "fmt" "log" - "os" "github.com/google/go-github/github" _ "github.com/joho/godotenv/autoload" @@ -62,6 +60,11 @@ func main() { continue } + if repo.Description == nil { + desc := "" + repo.Description = &desc + } + name := repo.GetName() desc := repo.GetDescription() refn := repo.GetGitURL() @@ -72,35 +75,35 @@ func main() { continue } - const blurb = `Name: ${NAME} -Description: ${DESC} -Reference Number: ${REFN} -Date of creation: ${CREAT} -Date of last modification: ${LASTM} -Other owners: none + const blurb = `name: ${name} +description: ${desc} +reference number: ${refn} +date of creation: ${creat} +date of last modification: ${lastm} +other owners: none ` mapping := func(inp string) string { switch inp { - case "NAME": + case "name": return name - case "DESC": + case "desc": if desc == "" { - panic("no description for " + refn) + return "no description available" } return desc - case "REFN": + case "refn": return refn - case "CREAT": - return creat.String() - case "LASTM": - return lastm.String() + case "creat": + return creat.string() + case "lastm": + return lastm.string() } return "<unknown input " + inp + ">" } - fmt.Println(os.Expand(blurb, mapping)) + fmt.println(os.expand(blurb, mapping)) } } @@ -2,6 +2,7 @@ module within.website/x require ( cirello.io/goherokuname v0.0.0-20190914093443-b436bae8c2c5 + code.gitea.io/sdk/gitea v0.13.1 git.xeserv.us/xena/jvozba v0.0.0-20190616002803-f274e24d1e52 github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6 github.com/Yawning/bulb v0.0.0-20170405033506-85d80d893c3d @@ -3,6 +3,9 @@ bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cirello.io/goherokuname v0.0.0-20190914093443-b436bae8c2c5 h1:W1xHfkFJ/G3/KGsRFV1S9DPFM6yB+ndu4Tbnvp7Ec1E= cirello.io/goherokuname v0.0.0-20190914093443-b436bae8c2c5/go.mod h1:lfp+7qXdkiHbLqAvsA4v2Cyll5djTKZTiNi+iDfPJcw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +code.gitea.io/sdk v0.11.0 h1:R3VdjBCxObyLKnv4Svd/TM6oGsXzN8JORbzgkEFb83w= +code.gitea.io/sdk/gitea v0.13.1 h1:Y7bpH2iO6Q0KhhMJfjP/LZ0AmiYITeRQlCD8b0oYqhk= +code.gitea.io/sdk/gitea v0.13.1/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= git.xeserv.us/xena/jvozba v0.0.0-20190616002803-f274e24d1e52 h1:MumuDSv8Ebsal1C98APrRRb8JyX+FpKiyGT/8fiMjaw= git.xeserv.us/xena/jvozba v0.0.0-20190616002803-f274e24d1e52/go.mod h1:lPdeNnexyxX+GQt62HV9UypJDg9enMwadWLXazGUUuc= github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6 h1:9cJcTOeILzInNo+DCYmXKME1QfAP07FYdo3M9/9jyc4= @@ -70,6 +73,8 @@ github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/U github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hullerob/go.farbfeld v0.0.0-20181222022525-3661193c725f h1:1LkiAnH6RhOEbQAcfcEcixM5IsegqFi6IH0Nz0ZGqYs= github.com/hullerob/go.farbfeld v0.0.0-20181222022525-3661193c725f/go.mod h1:mQEoc766DxPTAwQ54neWTK/lFqIeSO7OU6bqZsceglw= github.com/jaytaylor/html2text v0.0.0-20190408195923-01ec452cbe43 h1:jTkyeF7NZ5oIr0ESmcrpiDgAfoidCBF4F5kJhjtaRwE= |
