diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-21 23:33:25 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-21 23:33:25 +1000 |
commit | 3d49ab666676ede1b3c849d56ccd2099a7701709 (patch) | |
tree | 497310c52607a6c30a0d2b54e26cd8883670390a /pkg | |
parent | 042c83387e51c03ca48427a9e8678c389cbbc887 (diff) | |
parent | 483b4d939d334d87efefe7cc435a765194a41308 (diff) |
Merge pull request #202 from dawidd6/test
Fix testPath for debian packaging
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/test/test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/test/test.go b/pkg/test/test.go index 7bdbd4c10..ff133a655 100644 --- a/pkg/test/test.go +++ b/pkg/test/test.go @@ -4,6 +4,7 @@ import ( "errors" "os" "os/exec" + "path/filepath" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -11,7 +12,14 @@ import ( // GenerateRepo generates a repo from test/repos and changes the directory to be // inside the newly made repo func GenerateRepo(filename string) error { - testPath := utils.GetProjectRoot() + "/test/repos/" + reposDir := "/test/repos/" + testPath := utils.GetProjectRoot() + reposDir + + // workaround for debian packaging + if _, err := os.Stat(testPath); os.IsNotExist(err) { + cwd, _ := os.Getwd() + testPath = filepath.Dir(filepath.Dir(cwd)) + reposDir + } if err := os.Chdir(testPath); err != nil { return err } |