mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
organise keybindings better
This commit is contained in:
parent
32ddf0c296
commit
e68dbeb7eb
6 changed files with 28 additions and 17 deletions
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue