1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Merge branch 'master' into 157_remove_bom

This commit is contained in:
Tommy Nguyen
2018-08-19 07:22:48 -04:00
29 changed files with 599 additions and 64 deletions

View File

@ -69,3 +69,14 @@ func NormalizeLinefeeds(str string) string {
str = strings.Replace(str, "\r", "\n", -1)
return str
}
// GetProjectRoot returns the path to the root of the project. Only to be used
// in testing contexts, as with binaries it's unlikely this path will exist on
// the machine
func GetProjectRoot() string {
dir, err := os.Getwd()
if err != nil {
panic(err)
}
return strings.Split(dir, "lazygit")[0] + "lazygit"
}