1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-26 16:31:18 +03:00

fix open command

This commit is contained in:
Jesse Duffield
2018-08-14 18:35:47 +10:00
parent bde6182c94
commit c476dfc1cb

View File

@@ -109,7 +109,7 @@ func (c *OSCommand) GetOpenCommand() (string, string, error) {
"open": "", "open": "",
} }
for name, trail := range trailMap { for name, trail := range trailMap {
if out, _ := c.RunCommandWithOutput("which " + name); out != "exit status 1" { if err := c.RunCommand("which " + name); err == nil {
return name, trail, nil return name, trail, nil
} }
} }
@@ -137,7 +137,8 @@ func (c *OSCommand) OpenFile(filename string) (*exec.Cmd, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
return nil, c.RunCommand(cmdName + " " + filename + cmdTrail) // TODO: ensure this works given that it's not rundirectcommand err = c.RunCommand(cmdName + " " + filename + cmdTrail) // TODO: test on linux
return nil, err
} }
// EditFile opens a file in a subprocess using whatever editor is available, // EditFile opens a file in a subprocess using whatever editor is available,