diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-12-21 09:37:48 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-02-08 14:40:30 -0800 |
commit | 09f32d4f845511638ec162be426eeffb51036b6b (patch) | |
tree | 1f628ef91273e37da8bc5f4d901f1a91ba865fa6 /pkg/test | |
parent | 6f0f70bd924b444a5f755046c1da25c0f31e352e (diff) |
add secureexec file for getting around windows checking for a binary first in the current dir
Diffstat (limited to 'pkg/test')
-rw-r--r-- | pkg/test/test.go | 4 | ||||
-rw-r--r-- | pkg/test/utils.go | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pkg/test/test.go b/pkg/test/test.go index 38eabc6a4..da476b95c 100644 --- a/pkg/test/test.go +++ b/pkg/test/test.go @@ -2,11 +2,11 @@ package test import ( "os" - "os/exec" "path/filepath" "github.com/go-errors/errors" + "github.com/jesseduffield/lazygit/pkg/secureexec" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -24,7 +24,7 @@ func GenerateRepo(filename string) error { if err := os.Chdir(testPath); err != nil { return err } - if output, err := exec.Command("bash", filename).CombinedOutput(); err != nil { + if output, err := secureexec.Command("bash", filename).CombinedOutput(); err != nil { return errors.New(string(output)) } diff --git a/pkg/test/utils.go b/pkg/test/utils.go index b27bdbbab..47f2c1146 100644 --- a/pkg/test/utils.go +++ b/pkg/test/utils.go @@ -7,6 +7,7 @@ import ( "strings" "testing" + "github.com/jesseduffield/lazygit/pkg/secureexec" "github.com/mgutz/str" "github.com/stretchr/testify/assert" ) @@ -27,7 +28,7 @@ func (i *CommandSwapper) SwapCommand(t *testing.T, cmd string, args []string) *e } splitCmd = str.ToArgv(i.Replace) - return exec.Command(splitCmd[0], splitCmd[1:]...) + return secureexec.Command(splitCmd[0], splitCmd[1:]...) } // CreateMockCommand creates a command function that will verify its receiving the right sequence of commands from lazygit |