organise keybindings better

This commit is contained in:
Jesse Duffield 2019-03-22 20:13:48 +11:00
parent 32ddf0c296
commit e68dbeb7eb
6 changed files with 28 additions and 17 deletions

View file

@ -31,7 +31,10 @@ func main() {
for _, lang := range langs {
os.Setenv("LC_ALL", lang)
mApp, _ := app.NewApp(mConfig)
file, _ := os.Create("Keybindings_" + lang + ".md")
file, err := os.Create(getProjectRoot() + "/docs/keybindings/Keybindings_" + lang + ".md")
if err != nil {
panic(err)
}
bindingSections := getBindingSections(mApp)
content := formatSections(mApp, bindingSections)
@ -126,3 +129,11 @@ func formatSections(mApp *app.App, bindingSections []*bindingSection) string {
return content
}
func getProjectRoot() string {
dir, err := os.Getwd()
if err != nil {
panic(err)
}
return strings.Split(dir, "lazygit")[0] + "lazygit"
}