mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-08 04:04:22 +02:00
Merge pull request #202 from dawidd6/test
Fix testPath for debian packaging
This commit is contained in:
commit
3d49ab6666
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||||
)
|
)
|
||||||
@ -11,7 +12,14 @@ import (
|
|||||||
// GenerateRepo generates a repo from test/repos and changes the directory to be
|
// GenerateRepo generates a repo from test/repos and changes the directory to be
|
||||||
// inside the newly made repo
|
// inside the newly made repo
|
||||||
func GenerateRepo(filename string) error {
|
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 {
|
if err := os.Chdir(testPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user