Skip to content

Commit

Permalink
Add Umlaut conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
NickRTR committed Sep 25, 2023
1 parent 7b8b792 commit bb31c0c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@ func authenticate() (*github.Client, context.Context) {
return github.NewClient(tc), ctx
}

func formatUmlauts(text string) string {
// Replace ä with ae, ö with oe, ü with ue, ß with ss
text = strings.ReplaceAll(text, "ä", "ae")
text = strings.ReplaceAll(text, "ö", "oe")
text = strings.ReplaceAll(text, "ü", "ue")
text = strings.ReplaceAll(text, "ß", "ss")

return text
}

func createRepo(client *github.Client, ctx context.Context) string {
brint("Creating Repository...")
repo := &github.Repository{
Name: github.String(title),
Name: github.String(formatUmlauts(title)),
Private: github.Bool(private),
}
res, _, err := client.Repositories.Create(ctx, organization, repo)
Expand Down

0 comments on commit bb31c0c

Please sign in to comment.