From 574e0b6f906b50b1c196f0b97b81a4018e097b9c Mon Sep 17 00:00:00 2001 From: Gustavo Andrioli Date: Mon, 10 Oct 2022 21:22:55 -0300 Subject: [PATCH] Remove GetLazydockerRootDirectory function --- pkg/utils/utils.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index baf5cf5c..fe1ae3de 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -5,10 +5,7 @@ import ( "fmt" "html/template" "io" - "log" "math" - "os" - "path/filepath" "reflect" "regexp" "sort" @@ -411,31 +408,3 @@ func IsValidHexValue(v string) bool { return true } - -// GetLazydockerRootDirectory finds lazydocker root directory. -// -// It's used for our cheatsheet script and integration tests. Not to be confused with finding the -// root directory of _any_ random repo. -func GetLazydockerRootDirectory() string { - path, err := os.Getwd() - if err != nil { - panic(err) - } - - for { - _, err := os.Stat(filepath.Join(path, ".git")) - if err == nil { - return path - } - - if !os.IsNotExist(err) { - panic(err) - } - - path = filepath.Dir(path) - - if path == "/" { - log.Fatal("must run in lazydocker folder or child folder") - } - } -}