1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00

support forked branches when getting project root

This commit is contained in:
Jesse Duffield 2018-08-19 15:05:36 +10:00
parent 6978785ccf
commit 93266cc2a4

View File

@ -4,7 +4,6 @@ import (
"fmt"
"log"
"os"
"path"
"path/filepath"
"strings"
@ -69,6 +68,9 @@ func TrimTrailingNewline(str string) string {
// in testing contexts, as with binaries it's unlikely this path will exist on
// the machine
func GetProjectRoot() string {
gp := os.Getenv("GOPATH")
return path.Join(gp, "src/github.com/jesseduffield/lazygit")
dir, err := os.Getwd()
if err != nil {
panic(err)
}
return strings.Split(dir, "lazygit")[0] + "lazygit"
}