diff options
Diffstat (limited to 'pkg/integration/components/runner.go')
-rw-r--r-- | pkg/integration/components/runner.go | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go index 32acdf25f..908d7e1d8 100644 --- a/pkg/integration/components/runner.go +++ b/pkg/integration/components/runner.go @@ -6,9 +6,11 @@ import ( "os/exec" "path/filepath" - "github.com/jesseduffield/lazycore/pkg/utils" + lazycoreUtils "github.com/jesseduffield/lazycore/pkg/utils" "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" + "github.com/jesseduffield/lazygit/pkg/utils" + "github.com/samber/lo" ) const ( @@ -30,7 +32,7 @@ func RunTests( keyPressDelay int, maxAttempts int, ) error { - projectRootDir := utils.GetLazyRootDirectory() + projectRootDir := lazycoreUtils.GetLazyRootDirectory() err := os.Chdir(projectRootDir) if err != nil { return err @@ -177,8 +179,17 @@ func getLazygitCommand(test *IntegrationTest, paths Paths, rootDir string, sandb return nil, err } - cmdArgs := []string{tempLazygitPath(), "-debug", "--use-config-dir=" + paths.Config(), "--path=" + paths.ActualRepo()} - cmdArgs = append(cmdArgs, test.ExtraCmdArgs()...) + cmdArgs := []string{tempLazygitPath(), "-debug", "--use-config-dir=" + paths.Config()} + if !test.useCustomPath { + cmdArgs = append(cmdArgs, "--path="+paths.ActualRepo()) + } + resolvedExtraArgs := lo.Map(test.ExtraCmdArgs(), func(arg string, _ int) string { + return utils.ResolvePlaceholderString(arg, map[string]string{ + "actualPath": paths.Actual(), + "actualRepoPath": paths.ActualRepo(), + }) + }) + cmdArgs = append(cmdArgs, resolvedExtraArgs...) cmdObj := osCommand.Cmd.New(cmdArgs) |