diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-12-29 11:41:33 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-04 09:07:15 +1100 |
commit | 03b946cc8f9e94fe3fd53ac619ace2af2662aac2 (patch) | |
tree | 14dff36f8b3874dda80dd606403a83c212084e6b /pkg/commands/oscommands | |
parent | 18ab08612687b34ccfccd0b8d12d8d73e38b8857 (diff) |
no more config in git command struct
Diffstat (limited to 'pkg/commands/oscommands')
-rw-r--r-- | pkg/commands/oscommands/os.go | 4 | ||||
-rw-r--r-- | pkg/commands/oscommands/os_default_test.go | 4 | ||||
-rw-r--r-- | pkg/commands/oscommands/os_windows_test.go | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index f28f28c06..931be80b7 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -485,3 +485,7 @@ func sanitisedCommandOutput(output []byte, err error) (string, error) { } return outputString, nil } + +func GetTempDir() string { + return filepath.Join(os.TempDir(), "lazygit") +} diff --git a/pkg/commands/oscommands/os_default_test.go b/pkg/commands/oscommands/os_default_test.go index 5e15b1498..60b45f0dd 100644 --- a/pkg/commands/oscommands/os_default_test.go +++ b/pkg/commands/oscommands/os_default_test.go @@ -57,7 +57,7 @@ func TestOSCommandOpenFileDarwin(t *testing.T) { OSCmd := NewDummyOSCommand() OSCmd.Platform.OS = "darwin" OSCmd.Command = s.command - OSCmd.Config.GetUserConfig().OS.OpenCommand = "open {{filename}}" + OSCmd.UserConfig.OS.OpenCommand = "open {{filename}}" s.test(OSCmd.OpenFile(s.filename)) } @@ -131,7 +131,7 @@ func TestOSCommandOpenFileLinux(t *testing.T) { OSCmd := NewDummyOSCommand() OSCmd.Command = s.command OSCmd.Platform.OS = "linux" - OSCmd.Config.GetUserConfig().OS.OpenCommand = `xdg-open {{filename}} > /dev/null` + OSCmd.UserConfig.OS.OpenCommand = `xdg-open {{filename}} > /dev/null` s.test(OSCmd.OpenFile(s.filename)) } diff --git a/pkg/commands/oscommands/os_windows_test.go b/pkg/commands/oscommands/os_windows_test.go index 720f2705a..60853b841 100644 --- a/pkg/commands/oscommands/os_windows_test.go +++ b/pkg/commands/oscommands/os_windows_test.go @@ -79,7 +79,7 @@ func TestOSCommandOpenFileWindows(t *testing.T) { OSCmd := NewDummyOSCommand() OSCmd.Command = s.command OSCmd.Platform.OS = "windows" - OSCmd.Config.GetUserConfig().OS.OpenCommand = `start "" {{filename}}` + OSCmd.UserConfig.OS.OpenCommand = `start "" {{filename}}` s.test(OSCmd.OpenFile(s.filename)) } |